I HAVE THIS
------------------------
Dim x: asdfasdfasdf
Dim y: rwefnmwlkej
I WANT THIS
------------------------
[Dim x:] asdfasdfasdf
[Dim y:] rwefnmwlkej
THIS IS WANT I USED
------------------------
Find What: D[^()]*:
Replace: [\1]
THIS IS WHAT I GET
------------------------
[\1]asdfasdfasdf
[\1]rwefnmwlkej
What am I doing wrong?
Simple Find and Replace
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
The \1 in your replacement expression doesn't refer tio anything, as there are no capturing parentheses in your regular expression.
Either use \0, which refers to the entire text that was matched:
Either use \0, which refers to the entire text that was matched:
or insert some capturing parentheses:Find what: D[^()]*:
Replace with: [\0]
[X] Regular expression
This assumes you are using Posix regular expression syntax:Find what: (D[^()]*:)
Replace with: [\1]
[X] Regular expression
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm