There's more than one way to do things | |
PerlMonks |
Re: wiki regex reprocessing replacement (UPDATED^2)by LanX (Saint) |
on Feb 15, 2020 at 16:55 UTC ( [id://11112991]=note: print w/replies, xml ) | Need Help?? |
UPDATES: Expanded test case with wrong markup to be ignored
> to call tf() recursively in the /e evaled replacement part seems to work well, see sub rec
ok 1 - repeated replace # 1< _/one *two*/ th/ree_ null _/f*ur *five*/ six_ null _/se_ven *eight*/ nine_ *fail_ # 2< /one *two*/ th/ree # 3< one *two* # 4< two # 4> two # 3> one two # 2> one two th/ree # 2< /f*ur *five*/ six # 3< f*ur *five* # 4< five # 4> five # 3> f*ur five # 2> f*ur five six # 2< /se_ven *eight*/ nine # 3< se_ven *eight* # 4< eight # 4> eight # 3> se_ven eight # 2> se_ven eight nine # 1> one two th/ree null f*ur five six null se_ven eight nine *fail_ ok 2 - recursive replace 1..2
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|