On Jan 16, 2004, at 3:38 PM, James Edward Gray II wrote:

Now I have to get it back out of the file and that's where it falls apart on me. I've tried things like:

$string =~ s/((?:^|[^\\])(?:\\\\)*)\\n/$1\n/g;
$string =~ s/\\\\/\\/g;

Sorry to reply to my own post, but does this work? It seems to in all the test cases I can dream up:


$string =~ s/\\([n\\])/$1 eq "\\" ? $1 : "\n"/ge;

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to