How to replace with variable length characters?
Posted: Fri Dec 12, 2014 2:27 am
Ex: replace o to 0 in context.
I have some original context like this:
1o, 2o, 3oo, 5oo, 2ooo, 35oo, 2ooooo-43oooo, Book, look, other, etc.
It's numeric 0 has been set to o in context, so I need to restore character o to 0 after numeric character 1-9, but I can not replace all o to 0 directly because it have another none numeric character o in other word.
I can find target by search condition ([0-9]+)(o+), but I can't replace it because I can put $1 in replace parameter header, but the $2 is a variable length o character. I don't know how to replace this variable length o to variable length 0.
Repeating execute replace regex ([0-9]+)o{1} is unacceptable because I must put it in batch replace. How should I set this regex replace string in this case?
I have some original context like this:
1o, 2o, 3oo, 5oo, 2ooo, 35oo, 2ooooo-43oooo, Book, look, other, etc.
It's numeric 0 has been set to o in context, so I need to restore character o to 0 after numeric character 1-9, but I can not replace all o to 0 directly because it have another none numeric character o in other word.
I can find target by search condition ([0-9]+)(o+), but I can't replace it because I can put $1 in replace parameter header, but the $2 is a variable length o character. I don't know how to replace this variable length o to variable length 0.
Repeating execute replace regex ([0-9]+)o{1} is unacceptable because I must put it in batch replace. How should I set this regex replace string in this case?