[PHP] Regex error

2007-03-14 Thread jekillen

Hello;
The following regex:

ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})' 
id='$m[1]', $groups, $m1);


is causing the following error:

Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on 
line 81


Can someone tell me what this means?

What I am trying to do is pick out some info from an xml tag the is 
id'd by

$m[1] ( a match from a preceding regex. This regex is only supposed to
be applied if there is an $m[1] match. This happened without the
dot (.) and forward slash escaped in the uspace=' etc ' section. I used
back slashes to see if that made a difference, it does not. I have 
gotten

a little hazy on what needs to be escaped in character classes.

 I have written a number of
similar regexs in the same collections of scripts and I can not see what
this one is complaining about.
php v5.1.2, Apache 1.3.34, FreeBSD v6.0
Thanks in advance
Jeff K

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regex error

2007-03-14 Thread Myron Turner

jekillen wrote:

Hello;
The following regex:

ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})' 
id='$m[1]', $groups, $m1);


is causing the following error:

Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on 
line 81


Can someone tell me what this means?

What I am trying to do is pick out some info from an xml tag the is 
id'd by

$m[1] ( a match from a preceding regex. This regex is only supposed to
be applied if there is an $m[1] match. This happened without the
dot (.) and forward slash escaped in the uspace=' etc ' section. I used
back slashes to see if that made a difference, it does not. I have gotten
a little hazy on what needs to be escaped in character classes.

 I have written a number of
similar regexs in the same collections of scripts and I can not see what
this one is complaining about.
php v5.1.2, Apache 1.3.34, FreeBSD v6.0
Thanks in advance
Jeff K



What is this part of the regex supposed to be doing: [a-z0-9-\.\/] ?
Your problem is this: 0-9-, which causes a bad range error.




--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regex error

2007-03-14 Thread Richard Lynch




On Wed, March 14, 2007 7:56 pm, jekillen wrote:
 Hello;
 The following regex:

 ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})'
 id='$m[1]', $groups, $m1);

 is causing the following error:

 Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on
 line 81

 Can someone tell me what this means?

You used to have the - after the 9 at the end, and then you tacked on
the \. and \/ after that, and now PCRE is trying to use the - as if it
were a range-specifier, like, a-z or 0-9, only you've got,
essentially, a-z0-9-.

This makes no sense at all, as it sort of means 'a to z'  or '0 to 9'
or, umm, '9 to .' or something like that, only not.

Move the - to the END of the pattern, right after the \/

PS
Technically, \ is a special character inside of quotes in PHP, as well
as an escape character for PCRE, so you really should use \\. and \\/

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regex error

2002-01-21 Thread Bas Jochems

use
 $rgTemp = split('[|]',$szTag);

instead of
 $rgTemp = split(|,$szTag);

on line 2


PHP List wrote:

 Hi,
 Can someone please tell me why the this is happening:

 1)   $szTag = test|3;
 2)   $rgTemp = split(|,$szTag);
 3)   $szTag = $rgTemp[0];
 4)   $nItemID = $rgTemp[1];
 ^line numbers for ref only, not in actual code.

 Will give me the error:
 PHP Warning:  unexpected regex error(14) in /test.php on line 2

 What is an error 14 ?

 Thanks,
 Chris

 --
 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]




-- 
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]




[PHP] Regex error

2002-01-18 Thread PHP List

Hi,
Can someone please tell me why the this is happening:

1)   $szTag = test|3;
2)   $rgTemp = split(|,$szTag);
3)   $szTag = $rgTemp[0];
4)   $nItemID = $rgTemp[1];
^line numbers for ref only, not in actual code.


Will give me the error:
PHP Warning:  unexpected regex error(14) in /test.php on line 2

What is an error 14 ?



Thanks,
Chris



-- 
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]




Fwd: Re: [PHP] Regex error

2002-01-18 Thread bvr


split() takes a regular expression,

this means you have to escape the | char with a \

like this:

$rgTemp = split(\|,$szTag);

bvr.

On Fri, 18 Jan 2002 14:40:25 -0800, PHP List wrote:

Hi,
Can someone please tell me why the this is happening:

1)   $szTag = test|3;
2)   $rgTemp = split(|,$szTag);
3)   $szTag = $rgTemp[0];
4)   $nItemID = $rgTemp[1];
^line numbers for ref only, not in actual code.


Will give me the error:
PHP Warning:  unexpected regex error(14) in /test.php on line 2

What is an error 14 ?




-- 
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]