Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: matching a line with ' and "

by gaal (Parson)
on Jul 18, 2008 at 05:48 UTC ( #698514=note: print w/ replies, xml ) Need Help??

in reply to matching a line with ' and "

Have you tried Text::Balanced? Or, if quotes can't be escaped, something like (untested):

while (my ($var) = $line =~ s/^(\s*['"]+=//) { # eat single var # eat a single quoted value and its trailing whitespace. $line =~ s/^'([^']+)'\s*// || $line =~ s/^"([^"]+)"\s*// || die "invalid"; # or return, whatever you need } # if we haven't consumed all our input, this line is invalid. die "invalid" if length $line;

Comment on Re: matching a line with ' and "
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2015-11-30 21:50 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 (783 votes), past polls