in reply to Regex with newline

I have had similar problems, its besause it puts a hard return in with the newlines.

Use:
$string =~ s/\r\n/<br>/g; or $string =~ s/\n\r/<br>/g;
not sure which.

my $name = 'Ben Kittrell'; $name=~s/^(.+)\s(.).+$/\L$1$2/g; my $nick = 'tha' . $name . 'sta';

Replies are listed 'Best First'.
Re: Re: Regex with newline
by schumi (Hermit) on Jun 25, 2001 at 20:31 UTC
    I just had a similar problem, and this solved it. Thanks a bunch, merlyn and thabenksta!

    --cs