> Yes, Perl is greedy
I was actually using ereg which I believe is POSIX, so POSIX must be greedy
too!
Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯
--
PHP
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("scott [gts]") wrote:
> preg_match('//', $text, $matches)
>
> in the case of perl regexp's, you have to specifically
> tell the regexp not to be greedy. the "?" regexp modifier
> is how you do this. (otherwise, the regexp will try and
> match
> > That's because POSIX is greedy. Or Perl is greedy. Whatever.
>
> Perl is greedy. It *should* have worked with eregi...
>
> > >
Yes, Perl is greedy (there has to be some kind of default behaviour)!
BUT it is SO easy to make it decent:
//
that's it!!!
michi
--
GMX - Die Kommunikations
;sasfd asdf asdf
>
>
>and the non-greedy will match something like this:
>now
>
>
>
>
>
>> -Original Message-
>> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
>> Subject: Re: [PHP] Help with simple regular expression
>>
>>
>> Th
f asdf
the greedy will match something like this:
now>
sasfd asdf asdf
and the non-greedy will match something like this:
now
> -Original Message-----
> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Help with simple regular expression
>
>
>
On Monday 25 June 2001 09:27, Richard Lynch wrote:
> That's because POSIX is greedy. Or Perl is greedy. Whatever.
Perl is greedy. It *should* have worked with eregi...
> >
> >
> > Unfortunately it matches everything from the body tag onwards and
> > doesn't stop at the greater-than sign. It s
]*> worked... thanks Kristian...
As I get it -- match http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Try this: /\]*\>/
Hope this helps
Kristian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
> (eg. )
Lol... by the way gg must be an interesting color :)
Aral
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯
--
PHP General Mailing List (http://www.php.ne
9 matches
Mail list logo