On Fri, Oct 04, 2002 at 03:59:10PM +0100, nemesis wrote:
> 
> Hi all,
> 
> I have a bunch of jokes that people have forwarded me over the years[1] and they 
> all have really bad formatting [2].  I am lazy and want to do as much formatting 
> of the jokes as I can automatically.  I have tried this piece of code to get rid 
> of any '>' or whitespace charachters before the 'beginning' of each line of the 
> text, but it just returns the same text as before:
> 
> foreach my $line (@body) {
>       $_ = $line;
>       s/^(?:>|\s)*(.*)$/$1/g;
>       print;
> }

I would use something like:

   s#^[> ]+##mg;

--
Nick

Reply via email to