In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("yanto") wrote:
> (eregi("([0-9][a-z][A-Z]\.[0-9][a-z][A-Z]", $myArray[x]))
>
> and don't use character '^' in front of the pattern.
(Note that since the parentheses are unbalanced, the above will thorw a
parse error.)
Since it's eregi, you don't need both [a-z] and [A-Z]. And by putting the
digits and letters in separate character classes, the pattern can only
match strings with one digit followed by two letters, a dot, another digit,
and more more letters. IOW:
1ab.2Cd
3zY.9MX
(etc.)
Since the goal is to match like this...
> I want to match any of the following:
>
> 1.1 or a.a
>
> or 1111.1111 or aaaa.aaaa <-- any number of digits (0-9) or alpha (a-z)
> on either side of the dot.
...try something more like this..
eregi("[0-9a-z]+\.[0-9a-z]+", $myArray[x])
...which would match as shown in the samples, where a single matched
character on either side of the decimal is repeating. (change the plus
signs to asterisks if "any" number of letters/digits can include no
letters/digits.)
--
CC
--
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]