Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Regex help

by jayto (Acolyte)
on Jun 21, 2012 at 15:11 UTC ( [id://977666]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Regex help
in thread Regex help

Thanks this was really helpful, you pretty much did all the work for me. I am trying to understand your regex expression which will take a bit. One more questions, is there no way to record the "# Record" column cells as being blank?

Replies are listed 'Best First'.
Re^5: Regex help
by kennethk (Abbot) on Jun 22, 2012 at 13:09 UTC

    Recording the "# Record" column cells as being blank is easy; the hard part would be changing the expression to record non-blank entries. You could just add an empty pair of parentheses, a la /^\s*(\S+)\s+(\S+)\s*()$/. Given that none of the lines contain three non-space blocks, you might even say /^\s*(\S+)\s+(\S+)\s*(\S*)\s*$/. Keep in mind that given these are such general expressions, it is absolutely essential that you test this against real input and be skeptical of the results.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found