Topic awaiting preservation: bad stuff (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 12-12-2001 05:11
ok, I know how to do this in perl, but I need to do it in php. I need to check that a string is only numbers, letters, spaces, and underscores. It doesn't have to be all of those, it just can't be something other than those. Any help would be greatly appreciated. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 12-12-2001 07:14 |
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 12-14-2001 01:07
are the characters used in regular expressions the same in php and perl? |
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 12-14-2001 01:10
also, what does the \x20 part mean? |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-14-2001 01:38
They are in a preg_reg match which use perl regular expression syntax. |
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 12-14-2001 02:15
yes, I did some looking and I think that's what the \x thing does, but then what's the 20 for, Maybe it's part of removing whitespace, because %20 is a space, hmmmm. Hopefully Mr. Max comes back here to tell me |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-14-2001 02:19
You can count on mr.maX comming along here sooner or later. |
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 12-14-2001 02:22
can someone give me a quick email address validification php script as well, it'd be greatly appreciated. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 12-14-2001 02:55
If you mean just to check to see if it fits the proper form of an email address you can use this: |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 12-14-2001 07:09
\x doesn't remove anything, \x20 simply specifies character with hexadecimal value (20 hex = 32 dec = space). |
Obsessive-Compulsive (I) Inmate From: chicago, IL usa |
posted 01-14-2003 22:23
Hello. I am trying to do the same, but the string must be four charachters. one letter followed by three numbers. the following works, but it allows more than three numbers. any suggestions? |
Paranoid (IV) Inmate From: Dallas, TX |
posted 01-14-2003 22:31
preg should be: |
Obsessive-Compulsive (I) Inmate From: chicago, IL usa |
posted 01-14-2003 22:47
thank you genis! |
Paranoid (IV) Inmate From: Dallas, TX |
posted 01-14-2003 23:05
no prob - and by the way, welcome! |
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 01-14-2003 23:12
wow, this topic got dug up again after over a year. |
Paranoid (IV) Inmate From: Dallas, TX |
posted 01-14-2003 23:26
wow, 13 months exactly... i didn't even notice. |