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

Re: Regex to match command line arguments

by broquaint (Abbot)
on May 08, 2003 at 12:50 UTC ( [id://256515]=note: print w/replies, xml ) Need Help??


in reply to Regex to match command line arguments

What would be a pattern that matches:
Something like this should do the trick
my $re = qr/\s -D?jetty\.home= (.+?) (?:\s|$) /x; /$re/ and print "yup - $1" for q[-Dname1=2 -Dname2.3="anything" -jetty.home="c:\a\b\c"], q[-Dname1=2 -Dname2.3="anything" -Djetty.home=c:\a\b\c] __output__ yup - "c:\a\b\c" yup - c:\a\b\c
See. perlre for more info.
HTH

_________
broquaint

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found