At 13:38 22.11.2002, @ Nilaab spoke out and said:
[snip]
Ok, I know this is easy for most of you, and believe me I've been searching
and trying to learn all about regular expressions, but I can't seem figure
out how to allow addition of spaces between
: [PHP] Simple RegExp Problem...
At 13:38 22.11.2002, @ Nilaab spoke out and said:
[snip]
Ok, I know this is easy for most of you, and believe me I've
been searching
and trying to learn all about regular expressions, but I can't
seem figure
out how
At 21:59 22.11.2002, @ Nilaab said:
[snip]
Thanks so much!!! It works. I didn't know I could also place extra
characters inside the brackets to specify what I want. :)
[snip]
The square brackets simply form a group
Thanks again Ernest! This will be extremely helpful to me in the near
future.
- Nilaab
-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 22, 2002 3:23 PM
To: @ Nilaab
Cc: Php-General
Subject: RE: [PHP] Simple RegExp Problem...
At 21
Hi,
you would be better off with preg_match, as its a little quicker apparently.
try:
preg_match(/^[:0-9a-f]*$/i,$string)
or change the * to a + to ensure $string is not null
the main problems you had:
- not ensuring that only those characters are found by using ^ and $
- not allowing
try this
ereg(^[a-zA-Z0-9:]*$,$string)
all your's is doing is looking for any char in $string that's a-z or A-Z or
0-9 or :
instead of all chars, from start to end, being them
-Original Message-
From: Adam Alkins [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 3:20 PM
To: PHP
that's because you're testing to see if '\n' is \n...single quotes mean:
interpret the text between literally, so '\n' is a backslash followed by
n...doulbe quotes mean: interpolate the value, so \n becomes a newline...
-Original Message-
From: Krzysztof Jarecki [mailto:[EMAIL
7 matches
Mail list logo