Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2016-12-03 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.