[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Foolish Perl Question
- Subject: [ale] Foolish Perl Question
- From: kkennedy at kenzoid.com (Ken Kennedy)
- Date: Sat, 23 Mar 2002 00:01:45 -0500
On Fri, Mar 22, 2002 at 03:31:50PM -0500, Tommie M. Jones wrote:
>
> >
>
> This should do it
> $line[7] =~ s/\[font color.*?\]//g;
>
> . - matches any legal character.
>
> *? Means nongreedy matching
>
> Nongreedy matching is used so it will stop at the first ']' instead of the
> last.
>
>
> I think this maybe a perl only trick.
Not perl only. Several other regex implementations have non-greedy
matching. Python I know does, for example. Even .NET *hack, thrbff*, I
think...
--
Ken Kennedy | http://www.kenzoid.com | kenzoid at io.com
PGP signature