 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[SA 6.4.199 preview] Code search&replace |
|
How do I use a grouped regular expression? What is the syntax for backreference? Also, what does the option Protect object names do?
|
|
Tue May 28, 2013 9:07 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
You should be able to use standard syntax for regular expressions. I'm not sure what you mean by grouped. Could you please provide more details.
The Protect option will spare names in ALTER PROCEDURE [name] code, and will replace in the bodies only. This applies to views and functions too.
|
|
Tue May 28, 2013 1:57 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
 |
 |
YouThe Protect option will spare names in ALTER PROCEDURE [name] code, and will replace in the bodies only. This applies to views and functions too. |
That makes sense, thanks.
 |
 |
You should be able to use standard syntax for regular expressions. I'm not sure what you mean by grouped. Could you please provide more details. |
Sure. I wanted to replace "([\s='])dbname_to_replace" with "\1new_db_name". The search part was processed properly but the replace part was inserted literally: "\1" was not replaced with the captured group. I tried "$1" as well, alas, to no avail.
|
|
Tue May 28, 2013 5:25 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Oh, I see. I'm sorry, but the regular expressions are only used for the text matching for the search operations. Presently, only a static string can be used as a replacement.
|
|
Tue May 28, 2013 11:36 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
But you plan to extend that to fully support regular expressions, both in search and replace parts, don't you?
|
|
Wed May 29, 2013 4:50 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|