Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Problem with regular expression

by sundialsvc4 (Abbot)
on Feb 12, 2013 at 19:25 UTC ( #1018432=note: print w/replies, xml ) Need Help??

in reply to Problem with regular expression

I would apply one or more regular expressions to identify whether-or-not this a string that you are interested in.   Then, write another regex to match only what you need from each.   Use a subroutine or subroutines; “regex golf” only goes so far.   Treat the two problems separately, and break each one down into as many cases as you need.

Obviously, entry #11 is the odd-man-out from all the rest.   You need to build a suite of examples of everything that the string could possibly be, and determine exactly what should be used to extract the data-of-interest from each one.   Then, I strongly recommend putting the whole thing to the Test::Most.   Write a test suite that proves the correct operation of the program.   Also, write the program itself so that it is suspicious of all its inputs and will, say, die() if it encounters anything that it cannot handle.   (Otherwise, you have no practical way to realize that a problem exists, either in the data or in the program or both.   The fact that the program ran cleanly should be a strong indicator that both the data and the software are correct.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018432]
[LanX]: yeah whatever ... I'm in the favorable condition to already autohiding him ... how can I judge the poor FOOLs who still see his contributions xD
[Eily]: he's been pretty saavy about threads that were implictly about him in the past. I think he might have deliberatly avoiding mentioning it for some reason (he got tired?)
[Eily]: he did mention one of his propositions: basically make it possible to ignore downvotes, by separating them more from the upvotes
Eily translate("Eilish ", "Proper English")

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2017-07-24 17:28 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (356 votes). Check out past polls.