On Oct 19, birgit kellner said: >my $header = "Joe Doe<br><br>The book I wrote yesterday"; >my $title; >if ($header =~ /(^\S.+)(<br><br>)(\S.+$)/m) { $title = "$1: $3";} >print "$title\n"; > >Is there a shorter, simpler, more efficient way to do this? I still need >$header later on as it is.
You could do: ($title = $header) =~ s/<br><br>/: /; That's a bit generalized -- I figure it will work as you expect it to in all cases. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]