Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://301732]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2018-03-21 00:22 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (262 votes). Check out past polls.