Re: [PHP] Help with simple regular expression

2001-06-26 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (scott [gts]) wrote: preg_match('/blah(.*?)/', $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

Re: [PHP] Help with simple regular expression

2001-06-26 Thread Aral Balkan
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

Re: [PHP] Help with simple regular expression

2001-06-25 Thread Christian Reiniger
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... body.* Unfortunately it matches everything from the body tag onwards and doesn't stop at the greater-than sign. It

RE: [PHP] Help with simple regular expression

2001-06-25 Thread scott [gts]
this: now sasfd asdf asdf /html 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 That's because POSIX is greedy. Or Perl is greedy. Whatever. When one

RE: [PHP] Help with simple regular expression

2001-06-25 Thread Mark Maggelet
[mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] Help with simple regular expression That's because POSIX is greedy. Or Perl is greedy. Whatever. When one of them does that, use the other one. Instead of eregi, use pregi. Disclaimer: What I know about Regex could fit in a matchbook

Re: [PHP] Help with simple regular expression

2001-06-25 Thread mailing_list
That's because POSIX is greedy. Or Perl is greedy. Whatever. Perl is greedy. It *should* have worked with eregi... body.* Yes, Perl is greedy (there has to be some kind of default behaviour)! BUT it is SO easy to make it decent: /body.*?/ that's it!!! michi -- GMX - Die

Re: [PHP] Help with simple regular expression

2001-06-24 Thread Aral Balkan
(eg. body bgcolor=gg) 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

RE: [PHP] Help with simple regular expression

2001-06-24 Thread Kristian Duske
body.* Try this: /\body[^\]*\/ 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]

Re: [PHP] Help with simple regular expression

2001-06-24 Thread Aral Balkan
body[^\]* worked... thanks Kristian... As I get it -- match body then any number of characters that aren't greater than signs then a greater than sign -- Is that right? (I'm really trying to get my head around this regex thing.) Thanks, Aral :) __ ([EMAIL