Using SQL Assistant 15.10.0305
I have statements in my code such as:
drop table M_B_v2
I want to replace all occurences of drop table (.*) with /* drop table (.*) */, i.e., I want to comment out any drop table statement.
This is what I tried in the SQL Assistant editor:
/* drop\1 */
/* drop 1 */
so it's not recognizing the backreference.
any suggestions/help would be greatly appreciated!
I've never paid attention to this option in the editor, since I mostly use Notepad++ to edit my SQL code.
I've searched a bit, $n is the syntax to refer a block, so go for /* drop$1 */ in your replace string and it will work.
But maybe you could have used a non regexp replace : "drop" to "-- drop" for the same purpose.
Thank you so much! $1 works.
I had only seen backreferencing done with \1.
I suppose there are many flavors of regular expression metacharacters!