Hey,
when i try to use question mark in eregi() it gives me:
Warning: eregi() [function.eregi]: REG_BADRPT in c:\myfiles\pagemaker\basefiles\classes.php on line 268
what is the problem?
Why can't i use ? in eregi()?
Moderator: General Moderators
whats the exact regex you used?
why not use preg_match? its faster and you can use the i pattern delimiter to make the search case insensitive.
why not use preg_match? its faster and you can use the i pattern delimiter to make the search case insensitive.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Moved to regex.
Could you post the regular expression you're using please?
As far as I know the ? should work in ereg (POSIX).
Perl-style regular expressions do make things a lot simpler though.... preg_match('/pattern/i', $string)
Could you post the regular expression you're using please?
Perl-style regular expressions do make things a lot simpler though.... preg_match('/pattern/i', $string)
Re: Why can't i use ? in eregi()?
You have not really provided all the information needed to make a good response, but I suspect your issue is that ? has a meaning for regex, it makes the preceding token option (zero or one allowed). If what preceedes it is not a valid token, then you would have a bad regex. You probably just want to escape it with a \.IAD wrote:Hey,
when i try to use question mark in eregi() it gives me:
Warning: eregi() [function.eregi]: REG_BADRPT in c:\myfiles\pagemaker\basefiles\classes.php on line 268
what is the problem?
This all assumes you are actually trying to match the character ? as a part of your regex.
HTH.