Re: newline regexes

2009-12-09 Thread jackassplus
It removes all singly occurring newlines. This is a negative, zero-width, look-behind assertion (?! \n )  It means that the variable does not match what it contains, in this case a newline, before the match but do not include what it matches in the match. This is a negative, zero-width,

Re: newline regexes

2009-12-05 Thread jackassplus
$data =~ s{ (?! \n ) \n (?! \n ) }{}gmsx; I have no Idea what that is supposed to do. the output from that is: \nSynopsis :\n\nA file / print sharing service is listening on the remote host.\n\nDescription :\n\nThe remote service understands the CIFS (Common Internet File System)\nor Server

newline regexes

2009-12-04 Thread jackassplus
I am trying to remove single newlines but not double newlines. for instance say I have the following: Name:\nMy Name\n\nAddress:\n123 Anywhere St\n\nAbout Me:\nSome text that\nhas some newlines that\nI want to be rid of\n\nThe End\n I want to get rid of all of the newlines between Me:\n and the

Re: newline regexes

2009-12-04 Thread jackassplus
The string \\n will not match a newline, it will match the two characters '\' and 'n'. I believe that's what I'm doing. Here is my test harness until I get this worked out: Input is from an XML File. #!/usr/bin/perl -w # load modules use DBI; use XML::Simple; # create xml object $xml = new