replacing numbers

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

replacing numbers

Postby benedict » Fri Nov 19, 2004 5:49 pm

Hello,
I'd like to append a Zero to the left of any 4 digit numbers.

Example:
2345 -> 02345
23 -> 23
54354 -> 54354

How is this possible? Thanks!
User avatar
benedict
Newbie
 
Posts: 2
Joined: Fri Nov 19, 2004 12:00 am

Re: replacing numbers

Postby Mofi » Sun Nov 21, 2004 5:07 am

Following regular expression replace in UltraEdit style with active Match Whole Word Only does the job:

Find What: ^([0-9][0-9][0-9][0-9]^)
Replace With: 0^1
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: replacing numbers

Postby benedict » Mon Nov 22, 2004 1:05 pm

Thank you very much. It is doing the job :)
User avatar
benedict
Newbie
 
Posts: 2
Joined: Fri Nov 19, 2004 12:00 am


Return to Find/Replace/Regular Expressions