> It removes all singly occurring newlines.
>
> This is a negative, zero-width, look-behind assertion (? 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, look-ahe
Hi!
This is a negative, zero-width, look-behind assertion (?
Huh? Until i read this, i actually though i understood regular expressions.
That one actually may solve one of my problems, too. Thanks!.. i think...
I'm going to have to meditate over that one.
LG
Rene
--
#!/usr/bin/perl #99BoB
jackassplus wrote:
>>> $data =~ s{ (?
> I have no Idea what that is supposed to do.
It removes all singly occurring newlines.
This is a negative, zero-width, look-behind assertion (?http://perldoc.perl.org/perlre.html#Extended-Patterns
--
Just my 0.0002 million dollars worth,
Shawn
Pro
> > $data =~ s{ (?http://learn.perl.org/
John W. Krahn wrote:
> Shawn H Corey wrote:
>> $data =~ s{ (? ^^
> Replace pattern with nothing. Oh oh!
$data =~ s{ (?http://learn.perl.org/
Shawn H Corey wrote:
jackassplus wrote:
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
>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 = ne
jackassplus wrote:
> 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
jackassplus wrote:
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 be