in reply to Re^3: bracket processing
in thread bracket processing
... for regexes in general, that's fine ... bracketed classes are different. ... Most characters that are meta characters in regular expressions ... lose their special meaning ... none of the characters in $delim required escaping.
In a character class, no one can hear your metacharacters scream. For the most part. The consequences of the occasional exception are what I seek to avoid with defensive measures like this. The effects of a change from
my $delim = '([{<';
to
my $delim = '(-[{<';
may not be readily apparent, yet still be very significant. One would hope that thorough testing would reveal a problem like this, but better IMHO to obviate the problem to begin with.
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: bracket processing
by kcott (Archbishop) on Apr 02, 2020 at 01:44 UTC | |
by AnomalousMonk (Archbishop) on Apr 02, 2020 at 03:16 UTC |