Quick ereg_replace question
| From: | Grant Rutherford | Date: | Tue, 02 Dec 2003 18:15:18 +0000 |
| Subject: | Quick ereg_replace question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171599@lists.php.net to get a copy of this message | ||
Hi,
I need a regular expression which will eliminate all characters except numbers, period, and +, -, *, or /
I am currently using:
$new_value = ereg_replace('[^0-9\.-/+*]', "", $value);
However, this seems to eliminate - as well. Any help would be appreciated.
Also, any good references for regular expressions?
Thanks,
Grant
--
Grant Rutherford
Iders Incorporated
100-137 Innovation Drive
Winnipeg, MB, Canada R3T 6B6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444
================================
Iders Incorporated: Confidential
================================
Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information. Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited. If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.