Re: [PHP] preg_match() returns false but no documentation why
- From: ceo@xxxxxxxxx ("Richard Lynch")
- Date: Wed, 30 May 2007 13:14:49 -0500 (CDT)
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
Hi all,
Can anybody spot why this doesn't seem to be working right? The manual
(
http://us2.php.net/preg_match) says it returns "false" on error, but
preg_last_error() returns 0, which I assume points to the
"PREG_NO_ERROR"
error code.
<code>
preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server)
You are missing the start/end delimiters is your first problem...
</code>
I also tried ereg(), and have searched and gone through the comments.
Why
would a regex operation return false?
It would return false if your string doesn't match the expression.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.
- Follow-Ups:
- Re: [PHP] preg_match() returns false but no documentation why
- From: "Jared Farrish"
- Re: [PHP] preg_match() returns false but no documentation why
- References:
- preg_match() returns false but no documentation why
- From: "Jared Farrish"
- preg_match() returns false but no documentation why
- Prev by Date: RE: [PHP] OOB problem, super stumped. (resolved)
- Next by Date: Re: [PHP] Streaming download to IE doesn't work
- Previous by thread: preg_match() returns false but no documentation why
- Next by thread: Re: [PHP] preg_match() returns false but no documentation why
- Index(es):
Relevant Pages
|