> 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.

Try listing the - as the first character (or last) so it's not seen as
showing a range.

> Also, any good references for regular expressions?

O'Reilly's "Mastering Regular Expressions", by Jeffrey Friedl.

HTH

--
Lowell Allen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to