Page 1 of 1
literal 0 in replace string after group substitution
Posted: Mon Dec 02, 2019 12:32 am
by 4EverMaAT
find
replace
but it is written as $10
and the replace text is written as $10 instead of $1 being the first group, followed by a literal 0
Any ideas?
Re: literal 0 in replace string after group substitution
Posted: Tue Dec 03, 2019 11:16 am
by DigitalVolcano
Try-
Putting the curly brackets round the number separates it from the following literals.
Re: literal 0 in replace string after group substitution
Posted: Tue Dec 03, 2019 3:46 pm
by 4EverMaAT
DigitalVolcano wrote: Tue Dec 03, 2019 11:16 am
Try-
Putting the curly brackets round the number separates it from the following literals.
I will remember that next time. I ended up doing
(a space between the $1 group and literal 0)
And then added a separate non-regex search into the batch for
(now a space between = and 0 from previous search/replace operation)
and replace with
(Removing the literal space after =)
That is what I liked about your software. I didn't have to drive myself crazy for 10 hours trying to make it perfectly efficient search. I just did it the crude way and it still worked out ok. But now I know also the more efficient way.