in reply to Re: TIMTOWTDI
in thread LCCS time complexity
Hi, looking at your REs I have a couple of suggestions:
$text =~ s/\[.*?\]/ /g; # you can lose the .*? by using [^\]]* which save the RE engine ba +cktracking # $text =~ s/\[[^\]]*\]/ /g; $text =~ s/[.,?"':&()!-]/ /g; $text =~ s/[^\w ]//g; # you need a /m to make this match # here # and here # and here # ie this will only match the very begining of the string $text =~ s/^\s+//; # ditto $text =~ s/\s+$//; $text =~ s/\s+/ /;
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: TIMTOWTDI
by rkg (Hermit) on Sep 11, 2003 at 10:38 UTC | |
by tachyon (Chancellor) on Sep 11, 2003 at 10:54 UTC |
In Section
Seekers of Perl Wisdom