Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How do I extract named variable names from regex string

by TomDLux (Vicar)
on Jan 30, 2012 at 17:04 UTC ( #950812=note: print w/ replies, xml ) Need Help??


in reply to How do I extract named variable names from regex string

Right now the regex is huge and complicated. Imagine trying to prove it captures everything you need, with no lost data, and it captures no more than you need, to maximze the data you can process in available memory. Or imagine you need to hire someone to make changes. You can hire a first year student at X kroner / hour, a second year student at X^2 k/h, a senior at X! k/h .... or even worse, imagine having to figure out next year, what you were had in mind when you programmed it.

If split partitions your problem into smaller, more easily understandable problems, that sounds like a good idea to me. Split is fast and efficient.

Alternately, define a number of small regex, and then assemble them into a larger structure. That way the components are named, so you have an idea what it is intended to achieve, and decipherment is bounded, with a limited number of characters to figure out. Compare to the regex-as-a-whole, where you can't tell where part one ends and part two begins.

As Occam said: Entia non sunt multiplicanda praeter necessitatem.


Comment on Re: How do I extract named variable names from regex string

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950812]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-04-21 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls