in reply to Regex with HTML::Entities
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex with HTML::Entities
by Horst.Lohnstein (Novice) on Nov 23, 2021 at 08:57 UTC | |
by Fletch (Bishop) on Nov 23, 2021 at 09:13 UTC | |
by ikegami (Patriarch) on Nov 23, 2021 at 15:00 UTC |