
miller
User
Apr 22, 2011, 9:56 AM
Post #2 of 3
(1663 views)
|
|
Re: [dendro] Need help with small but tricky job
[In reply to]
|
Can't Post
|
|
How are your single quoted strings escaped there? If it's a bash script, then there is no way to escape them. Or does a backslash work? Or doubling? The simpliest form of this type of regex would be the following. Basically separate the the parsing of the single quoted values from the escaping of the space characters:
my $str = q{command arg0='na me' arg1='oth r'}; $str =~ s{('.*?')}{my $q = $1; $q =~ s/(\s)/\\$1/g; $q}eg; print $str; If you give me more information on how your single quoted strings are escaped, I can show you a more complete regex. Examples of such escaping would be helpful. - Miller
(This post was edited by miller on Apr 22, 2011, 9:58 AM)
|