I'm trying to get a simple regex to work. Here is the test script I have.
#!/usr/bin/php -q
<?
$string = "hello\nworld\n";
$string = preg_replace("/[^\r]\n/i","\r\n",$string);
$string = addcslashes($string, "\r\n");
print $string;
?>
This outputs
hell\r\nworl\r\n
so it's removing the char before the \n also.
I just want it to replace a lone \n with \r\n
-Josh
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list