in reply to Re: Matching enclosed expression
in thread Matching enclosed expression

300 lines of URI

PLUS 100 of URI::QueryParam

PLUS grep

PLUS a regex,

when the regex alone (slightly modified) does the job? I don't get the logic?

If you need to parse a URI--ie extract the protocol, hostname, path, etc. etc,--then use these well-written, RFC-complient solutions--but if you need to extract one, small, easily defined, nicely delimited piece of text from another piece of text, then do what the Practical Extraction & Reporting Language is good at, use the highly optimised, much-copied & envied, incredibly powerful, highly-prized regex engine to extract that one piece of text from the other.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

  • Comment on Re: Re: Matching enclosed expression (downvote opportunity!)