in reply to Break a long regex across multiple lines of code, with comments
Use the 'x' modifier:
m/ (?<=a) # positive lookbehind for 'a' sd # literal 'sd' [^e] # ensure there isn't an 'e' here /x;
To help troubleshoot, you can set use re 'debug';, or use YAPE::Regex::Explain.
You might be inclined to show the regex, a bit of surrounding code, and a sample of your data, as there may be more efficient/cleaner ways to do this instead of using one long regex. We won't know though unless you provide more details.
-stevieb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [OT: Pedantic] Break a long regex across multiple lines of code, with comments
by AnomalousMonk (Archbishop) on Sep 23, 2015 at 03:19 UTC | |
by stevieb (Canon) on Sep 23, 2015 at 23:43 UTC | |
|
Re^2: Break a long regex across multiple lines of code, with comments
by davidfilmer (Sexton) on Sep 22, 2015 at 23:24 UTC | |
by Athanasius (Archbishop) on Sep 23, 2015 at 07:59 UTC |