Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Bit more help on this? Re: Re: parsing file/regex question

by smackdab (Pilgrim)
on Oct 23, 2003 at 21:31 UTC ( #301732=note: print w/ replies, xml ) Need Help??

in reply to Re: parsing file/regex question
in thread parsing file/regex question

Thanks, that does make sense, but does "break" the data driven approach I am trying to come up with...I have expanded the example and maybe someone will come up with a different idea...if not I'll do it the way suggested ;-)

$PRE = '\[\s*('; $VALID1 = '[-a-zA-Z0-9_.* \t\n]'; $VALID2 = '[-a-z0-9_.*\n]'; $VALID3 = '[a-zA-Z]'; $VALID4 = '[-a-zA-Z0-9]'; $PST = ')\s*\]'; while (<DATA>) { s/\\n/\n/g; #Are these harmless if s/\\t/\t/g; #not needed??? print "yep\n" if m/$PRE($VALID1+)$PST\s* $PRE($VALID2+)$PST\s* $PRE($VALID3+)$PST\s* $PRE($VALID4+)$PST\s* /x; } __DATA__ [TEST \n DATA] [ TEST DATA ] [ 2345423 ] [ TEST\tDATA ]\n [TEST \n DATA] [ TEST DATA ] [ 2345423 ] [ TEST DATA ]\n [TEST \n DATA] [ TEST DATA ] [ 2345423 ] [ TEST\tDATA ]\n

Comment on Bit more help on this? Re: Re: parsing file/regex question
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-11-25 01:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (666 votes), past polls