Re: [PHP] preg_match() returns false but no documentation why



On 5/30/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
>
> 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...

Which ones? I've got the starter "^" and the closer "$", so what else am I
missing?

would a regex operation return false?

It would return false if your string doesn't match the expression.


The manual claims it will return a 0 signaling "0 matches found." And then,
under "Return Values," it's says very quickly:

"*preg_match()* returns *FALSE* if an error occurred."

If it's not returning ANYTHING I'm assuming it's faulting, but the calling
the error function returns 0 (kind've ironic, really...).

--
Jared Farrish
Intermediate Web Developer
Denton, Tx

Abraham Maslow: "If the only tool you have is a hammer, you tend to see
every problem as a nail." $$


Relevant Pages

  • Problems Managing Required Field and Form Events
    ... Dim CheckVal As String ... If CheckVal = "Missing" Then ... Private Sub Form_BeforeUpdate ... Do you want to close the database object anyway? ...
    (microsoft.public.access.formscoding)
  • Problems Managing Required Field and Form Events
    ... Dim CheckVal As String ... If CheckVal = "Missing" Then ... Private Sub Form_BeforeUpdate ... Do you want to close the database object anyway? ...
    (microsoft.public.access.formscoding)
  • Re: Unicode question
    ... You're missing the existence and continued use of UTF-8 and UTF-16. ... I want to use an extended string that's good enough to cover UCS-4 ... sometimes multiple characters must be treated as one unit. ...
    (borland.public.delphi.non-technical)
  • A Problem Using Hashes
    ... I am inching my way through INTERMEDIATE PERL and tried using hashes to ... Use of uninitialized value in string eq at chap4-take6.pl line 49. ... gilligan is missing lotion ... professor is missing coat ...
    (perl.beginners)
  • Re: Finding words with capital letters and numbers in them
    ... As for the missing first letter... ... Function GetCapWordsAs String ... GetCapWords = GetCapWords & Delimiter & Words ... The TKRTC value in the 765TW field is not the default ...
    (microsoft.public.excel.programming)