"be consistent" | |
PerlMonks |
Re: Regex with HTML::Entitiesby Fletch (Bishop) |
on Nov 23, 2021 at 07:33 UTC ( [id://11139042]=note: print w/replies, xml ) | Need Help?? |
Not sure I'm completely following but it jumps out at me in your second block that the string in $b contains regular expression metacharacters (specifically parens) so that's prossibly the problem. Your "Adjektive (Nominalflexion)~87" is going to be treated as looking for the string "Adjektive" followed by a SPACE followed by the string "Nominalflexion" (which will be captured because of the parens) followed by "~87". If you use \Q\E escapes to setup as $c = "\Q{$sep$b$sep}\E" that should appropriately escape the metacharacters and let them match literally.
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|