Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Regular Expression to Extract Anything from Colon Delimited String

by Solo (Deacon)
on Oct 01, 2014 at 19:47 UTC ( #1102578=note: print w/replies, xml ) Need Help??


in reply to Regular Expression to Extract Anything from Colon Delimited String

The sample data you provide seems to fall into 3 different structures. It makes sense to me to first try to identify which structure a given line is, then parse the specific structure (by splitting into the correct slice of a hash, for example.)

If the sample data here is unrepresentative, another approach would be to separately define what each field should look like, then build full regexp's out of the pieces. For that approach look at Regexp::Assemble or dig into the sources for Regexp::Common.

  • Comment on Re: Regular Expression to Extract Anything from Colon Delimited String

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2021-08-06 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?