Hi,
I'm trying to use preg_replace to:
1) Check if a string contains any characters that are not allowed.
2) Replace any not allowed characters with a blank ''.
I've been using preg_match for a while and it's been fine for doing number 1 from the list above. However, I'm trying to find out if there is a way to reverse my pattern (that checks for unallowed characters in a string) for doing a number 2.
Is there a way to reverse a reg exp pattern by using [] or something?
Here is a sample pattern:/(\w+)(\W[<>]+)$/i
Any help is appreciated.
- Andy