regex , ereg() Problems???



I am having a problem verifying characters in a variable, I am trying
to create a conditional statement based on whether or not the first two
characters of a variable contain "E9". The variable will always be
either a 6 or a 7 digit, alpha-numeric string begining with "E". I have
tried the following ereg() statement and it picks up everything because
it begins with "E". I cannot seem to find any examples for matching
characters in a specific location within a string except for the
begining or the end. I am sure there is a simple solution. Any ideas??

(ereg("^[E9]", $enumber))

.



Relevant Pages

  • Re: regex , ereg() Problems???
    ... to create a conditional statement based on whether or not the first ... two characters of a variable contain "E9". ... either a 6 or a 7 digit, alpha-numeric string begining with "E". ... Rik Wasmus ...
    (comp.lang.php)
  • Re: Access/VBA Conditional Statement
    ... see if InstructorID = Me!Text5 and the rest of the characters I typed. ... : So I changed my conditional statement to read: ... Prev by Date: ...
    (comp.databases.ms-access)
  • Re: regex , ereg() Problems???
    ... to create a conditional statement based on whether or not the first ... two characters of a variable contain "E9". ... either a 6 or a 7 digit, alpha-numeric string begining with "E". ...
    (comp.lang.php)
  • Re: Access/VBA Conditional Statement
    ... I realized my mistake in the conditional statement - it was checking to ... see if InstructorID = Me!Text5 and the rest of the characters I typed. ...
    (comp.databases.ms-access)