Need to replace wildcard text between [ ]

Find, replace, find in files, replace in files, regular expressions

Need to replace wildcard text between [ ]

Postby Vistaview » Wed Sep 20, 2006 12:50 pm

Hi,
Having some difficulty trying to figure how to do the following;
Text file with lines such as
ab[1]=1[1,abc.........;
ab[2]=2[2,xyz.........;
ab[3]=3[3,def.........; etc

I need to delete the ab[1]=1[ from each line (or replace with a ,).
I know [ ] normally used for a range but cannot figure how to replace those brackets and the number range (up to 1000) between them.

Thx for thoughts.... :?
User avatar
Vistaview
Newbie
 
Posts: 1
Joined: Tue Sep 19, 2006 11:00 pm

Re: Need to replace wildcard text between [ ]

Postby Mofi » Thu Sep 21, 2006 9:51 am

As described in help of UltraEdit/UEStudio at the pages Find command and Regular expressions the escape character for the UltraEdit regex engine is ^ and for Unix/Perl regex it is \.

So the regex for the UltraEdit engine is: %*^[[0-9]+^]=[0-9]+^[

And for Unix/Perl: ^.*\[[0-9]+\]=[0-9]+\[     or    ^.*\[\d+\]=\d+\[
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions