It's not clear if you want the result to be "VARCHAR(n CHAR)" literally or "VARCHAR(20 CHAR)"
For the first, you search for "VARCHAR2\(+\)" (without the quotes) and in the replace box you have "VARCHAR(n CHAR)"
For the second you search for "VARCHAR2\((+)\)" and replace it with "VARCHAR(\1 CHAR)" resulting in
VARCHAR(5 CHAR) or
VARCHAR(20 CHAR) or
Using \( and \) searches for left and right parentheses.
Using () puts the stuff inside the () in one of nine hold buffers that you can then retrieve using \1, \2, \3, … \9
You had said "I'm able to find the occurrences with VARCHAR2.+." I suspect you had tried "VARCHAR2(+)" and that failed to match as the ( and ) were interpreted as being for a hold buffer. It would have matched "VARCHAR21234" but not "VARCHAR2(1234)"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo,
i want to replace
VARCHAR2(5) or
VARCHAR2(20) or
etc.
with VARCHAR(n CHAR)
I'm able to find the occurrences with
VARCHAR2.[0-9]+.
But how to replace them ? Is it possible to do a RegEx replace ?
Thanks,
Jochen
This page helped:
http://notepad-plus.sourceforge.net/uk/regExpList.php
search:
(VARCHAR2.[0-9]+).
replace:
\1 CHAR)
Quite simple :)
It's not clear if you want the result to be "VARCHAR(n CHAR)" literally or "VARCHAR(20 CHAR)"
For the first, you search for "VARCHAR2\(+\)" (without the quotes) and in the replace box you have "VARCHAR(n CHAR)"
For the second you search for "VARCHAR2\((+)\)" and replace it with "VARCHAR(\1 CHAR)" resulting in
VARCHAR(5 CHAR) or
VARCHAR(20 CHAR) or
Using \( and \) searches for left and right parentheses.
Using () puts the stuff inside the () in one of nine hold buffers that you can then retrieve using \1, \2, \3, … \9
You had said "I'm able to find the occurrences with VARCHAR2.+." I suspect you had tried "VARCHAR2(+)" and that failed to match as the ( and ) were interpreted as being for a hold buffer. It would have matched "VARCHAR21234" but not "VARCHAR2(1234)"