pgAdmin's internal find-replace/search-replace dialog using regex groups in the replace-box?

From: P O'Toole <P(dot)OToole(at)uwyo(dot)edu>
To: "pgadmin-hackers(at)postgresql(dot)org" <pgadmin-hackers(at)postgresql(dot)org>
Subject: pgAdmin's internal find-replace/search-replace dialog using regex groups in the replace-box?
Date: 2015-12-09 19:37:58
Message-ID: CY1PR0501MB1499F10BD817D1DD2CBF4FEAF8E80@CY1PR0501MB1499.namprd05.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hey, all.

I was wondering whether PgAdmin currently supports the functionality of replacing matched strings using one or more of the captured groups that come from the regex used to find the original strings/substrings. Using captured groups inside of replacements can be useful for altering syntax across a set of statements or (say) changing the order of a bunch of function-parameters if the signature has changed.

It appears that pgAdmin supports POSIX-esque regular-expressions (like PHP or Vim do), and allows regex-groups to be specified, however, other POSIX-y engines support using captured components in the replacements like \0, \1, \2, etc., where each number represents a component of the pattern, up to the ninth group.
For example, the pattern '\([^ \n]+n\)[ \n]' on the string "The pgAdmin client is pretty great." would cause \0 to be the whole match "pgAdmin " (including trailing space) whereas \1 would be "pgAdmin" (without the trailing space).

It would be great if replacements like this were supported, but after trying a few different variations on the replacement-syntax to no avail, I decided I'd just ask whether it's actually possible to get anything other than literal '\1's and '\0's back in the new string when I hit "replace". Is this currently possible in the latest version?

Thanks,
- Patrick

Application Developer
Wyoming Natural Diversity Database<uwyo.edu/wyndd>
UW Berry Biodiversity Conservation Center
Department 3381, 1000 E. University Av.
Laramie, WY 82071
P: 307-766-3018

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dmitriy Olshevskiy 2015-12-13 15:04:52 Re: patch: fix to use ``pg_get_functiondef()``
Previous Message Ashesh Vashi 2015-12-09 12:53:56 Re: pgAdmin III commit: A manual merge of few last commits from libssh2 res