in reply to Delimiters in Regexp::Common
I would like to sincerely thank everyone who added their comments on this topic. A lot of very in-depth detail about regexes was posted - thank you.
Initially I thought the following Regexp::Common expression was a great solution,
$P2 =~ /$RE{delimited}{-delim => '\\\/'}/
But then AnomalousMonk posted this expression,
$P2 =~ m{$RE{delimited}{-delim => '\/'}}
Its brilliant, and definitely my preferred choice because it lists the actual characters that are used as delimiters. The lesson I've learnt here is that if the delimiter character(s) are the same as those enclosing the regex, then choose a different set of characters to enclose the regex.
Once again, thank you for all the helpful posts!
- Ron.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delimiters in Regexp::Common
by AnomalousMonk (Archbishop) on May 09, 2018 at 15:28 UTC |