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!

Replies are listed 'Best First'.
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