Multiple Searches on position and Replace
Can I use regular expressions to do the multiple searches and replace in one file?
My wish :-)
- First search between position 10-13, to locate “FE45”
- Replace anything between position 4-6 to “000” of the record have “FE45” between position 10-13.
Thanks in advance!!!
Search mode: Regular expression
So for the find-what part we have:
- at the start of every line
- look for any 3 characters, capture as group #1
- look for any 3 characters
- look for any 3 characters (by assert-ing that they are there)
- look for FE45 (by assert-ing that they are there)
The parts in bold form the text that will be replaced with the replace-with expression, when there is a match on the find-with part:
- replace what was matched with group #1 contents plus 3 zeroes.
“assertion” is done by the (?=___) operator–the text that makes up this part of the regular expression doesn’t become part of the matched text, it just has to be there for a match to be declared.
Thank you so much, Scott!!!
Actually the first search should be between position 10-31, to locate “FE45.” Or it could be multiple search value: Either “FE45” or “DF3” between position 10-31.
My wish :-)
How should we update the regular expressions to do those search and replace above?