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.
The cake is a lie.
The cake is a lie.
In reply to Re: Regex with HTML::Entities
by Fletch
in thread Regex with HTML::Entities
by Horst.Lohnstein
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |