Re: REG_BADRPT error for regex

From: Date: Wed, 12 Jul 2000 13:37:48 +0000
Subject: Re: REG_BADRPT error for regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6138@lists.php.net to get a copy of this message
On Wed, 12 Jul 2000, Boget, Chris wrote: > "REG_BADRPT Indicates a ? (question mark), * (asterisk), or > + (plus sign) not preceded by valid basic or extended regular > expression." > > I found the above as a description of what my error represents. > However, I do not understand what it means. My regex is: > > eregi( "<rec>.*?<\/rec>", $news, $newsRecs ); > > How is "<\/rec>" not a 'valid basic or extended regular expression'? > > I'm using PHP3.0.5 so I cannot use the preg() functions and I > really need to get some sort of regex that does what I need; some- > thing that the regex above should be able to do. > Is there a work around? Or something? You're trying to use non-greedy syntax (.*?) in POSIX regexps which do not support it. You're stuck unless you use preg_*() functions. -Andrei The Heineken Uncertainty Principle: You can never be sure how many beers you had last night.

« previous php.general (#6138) next »