in reply to Re: How to strip comments and whitespace from a regex defined with /x?
in thread How to strip comments and whitespace from a regex defined with /x?
Hi Laurent,
I am well aware that using regexes to strip comments and whitespace out of an arbitrary regex is terrible, as that's what I am doing now. Fortunately the regexes I am working with are tightly controlled, and most of them are actually auto-generated, so I can be sure they have no whitespace or hash symbols in them.
But the nevertheless-gross nature of my solution made me wonder if there was something better, hence my thought about "asking the Regexp compiler what it has once it's done throwing away comments and whitespace"
|
|---|