Ask a Question related to PHP Development, Design and Development.
-
Yann Larrivee #1
preg, patern quantifier limit
Hi, i did a standard preg [A-Za-z0-9]{1,65536}
What i am simply trying to do is to validate the a form that will insert
into my TEXT database field. So i just want to prevent a larger insert
then expected.
PHP trows me this error "preg_match(): Compilation failed: number too
big in {} quantifier at offset 19 ..."
So it appears that quantifiers are limited. Anybody knows what that
limit is ?
Thanks
--
Yann Larrivee <yannl@istop.com>
Yann Larrivee Guest
-
syntax Error: invalid quantifier
syntax Error: invalid quantifier -
preg_match_all ? quantifier problem
The following pattern (which is one subpattern in a string of several) looks for the following $xxx,xxx.xx (with the dollar sign) or ... -
Unicode Patern matching
Hi, For three days I have been totally _unsuccessful_ at matching a two word pattern ("Windows 2000") in a unicode doc in a reasonable fashion. I... -
[PHP] greedy preg
> preg_replace("|<item>.*?$file.*?</item>|si","",$contents) Not sure if I understand you correct but the way you wrote your replace pattern the... -
greedy preg
$contents = preg_replace( "|<item>.*?$file.*?</item>|si", "", $contents ); it's being run on an XML file, where each entry is <item>......</item>... -
Curt Zirzow #2
Re: [PHP] preg, patern quantifier limit
* Thus wrote Yann Larrivee (yannl@istop.com):
It looks like it should be 65535, which makes more sense because> Hi, i did a standard preg [A-Za-z0-9]{1,65536}
>
> What i am simply trying to do is to validate the a form that will insert
> into my TEXT database field. So i just want to prevent a larger insert
> then expected.
>
>
> PHP trows me this error "preg_match(): Compilation failed: number too
> big in {} quantifier at offset 19 ..."
>
>
> So it appears that quantifiers are limited. Anybody knows what that
> limit is ?
that is the unsigned word boundry.
if you inisist on having a 65536 limit use strlen with the preg
if (strlen($str) <= 65536 && preg_match('/[A-Za-z0-9]+/', $str)) {
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Curt Zirzow Guest
-
David Nicholson #3
Re: [PHP] preg, patern quantifier limit
Hello,
This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at
20:35, lines prefixed by '>' were originally written by you.insert> Hi, i did a standard preg [A-Za-z0-9]{1,65536}
> What i am simply trying to do is to validate the a form that will
> insert
> into my TEXT database field. So i just want to prevent a largertoo> then expected.
> PHP trows me this error "preg_match(): Compilation failed: numberthat> big in {} quantifier at offset 19 ..."
> So it appears that quantifiers are limited. Anybody knows whatI can't help with your actual question, but I just thought I would> limit is ?
mention you can do what you are trying to do with...
if(strlen($text)>65536){
// too big
}
[url]http://php.net/strlen[/url]
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: [url]http://www.phpmachine.com/[/url]
Professional Web Development by David Nicholson
[url]http://www.djnicholson.com/[/url]
QuizSender.com - How well do your friends actually know you?
[url]http://www.quizsender.com/[/url]
(developed entirely in PHP)
David Nicholson Guest



Reply With Quote

