RexExp [OR]
| From: | Michael Richardson | Date: | Tue, 01 Aug 2000 16:55:28 +0000 |
| Subject: | RexExp [OR] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9478@lists.php.net to get a copy of this message | ||
Thanks in advance for your time.
I have an expression that can contain 0-9 or the word MAX, and nothing else.
I was looking for an efficient way to put this into one ereg_replace
statement.
Something close to ereg_replace("[^(MAX)0-9]", $string) ... Thus looking for
anything NOT the phrase MAX or 0-9 and stripping it.
I am aware of how to do it in multiple lines using if/then comparisons with
ereg matches. However, I would like to increase my programming prowess (and
lessen the time I spend typing) by coming up with a powerful syntax to do it
in one fell swoop.
Thanks again:
Michael Richardson