Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: matching a line with ' and "

by ww (Archbishop)
on Jul 18, 2008 at 11:36 UTC ( [id://698576]=note: print w/replies, xml ) Need Help??


in reply to Re: matching a line with ' and "
in thread matching a line with ' and "

Note that when the string includes mixed quoting which is not valid in the OP's terms:

my $string = qq{var1='1' var2="2" var3="3" var4='4" var5="5' var6="correct"};

...hipowls non-5.10 version (5.10 not tested) produces "ugly" output in the sense used by almut and skeeve

var1 = 1 var2 = 2 var3 = 3 var4 = 4" var5="5 var6 = correct

More significantly, if $str is in the form:

my $string = qq{var1='1' var2="2" var3="3" var4='4" var5="5'

...the output becomes:

var1 = 1 var2 = 2 var3 = 3 var4 = 4" var5=

...which is the same as the output produced if var5 is properly quoted, var5='5':

my $string = qq{var1='1' var2="2" var3="3" var4='4" var5='5'};

i.e.,

var1 = 1 var2 = 2 var3 = 3 var4 = 4" var5=

That sort of ambiguity may be a problem for OP.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found