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

Re: Help with regexp

by boo_radley (Parson)
on Nov 28, 2001 at 02:53 UTC ( #127948=note: print w/ replies, xml ) Need Help??


in reply to Help with regexp to capture quotes

requires rhs to be inside quotes.

while (<DATA>) { print $_; /="?([^"]+)"?/; print $1,"\n"; } __DATA__ FCP_REQID=103806 FCP_LOGIN="USER/PASS" FCP_USERID=3944 FCP_PRINTER="noprint"

Dragonchild : you're only capturing one character!


Comment on Re: Help with regexp
Download Code
Re: Re: Help with regexp
by CharlesClarkson (Curate) on Nov 28, 2001 at 08:35 UTC

    TIMTOWTDI
    I would prefer to use split.

    while (<DATA>) { print; ( my $after = (split /=/)[1] ) =~ s/"//g; print $after; } __END__ FCP_REQID=103806 FCP_LOGIN="USER/PASS" FCP_USERID=3944 FCP_PRINTER="noprint"



    HTH,
    Charles K. Clarkson


    Half a cookie is better than
Re: Re: Help with regexp
by duperdog (Initiate) on Nov 28, 2001 at 19:01 UTC
    Thanks for everyone's help, this one is what I was looking for.

    Thanks

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-07-24 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls