"Alan C." wrote:
> 
> John W. Krahn wrote:
> > "Alan C." wrote:
> <snipped>
> > Here is one way to do it:
> >
> > #!/perl/bin/perl -w
> > use strict;
> >
> > my $text = do { local $/; <> };
> > $text =~ s/\n(?!\.|\z)/ /g;
> > print $text;
> >
> Your code does the job just super! Thanks!
> The (|) parenthesis "group" with left side | right side sandwiched
> between the parenthesis
> The | means "or" right?

That is correct.

> then \z means end of string (end of my entire small amount of text)
> According to MRE2, the ?! is a fail-look ahead position matcher of sorts
> that enables a match-fail combo characteristic so all possible matches
> are returned?

The (?!) is a zero-width (doesn't advance the search position) negative
look-ahead assertion.  The substitution (s///) replaces all (/g global
option) newlines with a space but only if the newline is NOT followed by
a dot (.) or NOT at the end of the string (\z).



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to