jax0
asked on
Php regex [^abc] as group not individual letters
I understand that a regex written like:
[^abc]
means any character except a, b or c can appear once.
But how would I write the regex to equal any character except abc "as a group" and not individual letters.
I've already tried:
([^a][^b][^c]) didn't work.
([^abc]) didn't work.
can someone please assist?
thx
D-
[^abc]
means any character except a, b or c can appear once.
But how would I write the regex to equal any character except abc "as a group" and not individual letters.
I've already tried:
([^a][^b][^c]) didn't work.
([^abc]) didn't work.
can someone please assist?
thx
D-
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you, Pui_Yun, I'd not yet discovered that you can use NOT patterns (negative assertions) in PCRE.
http://php.net/manual/en/regexp.reference.assertions.php
That will come in handy, no doubt.
http://php.net/manual/en/regexp.reference.assertions.php
That will come in handy, no doubt.
No problem, I hope it comes in handy :)
P.
P.
(^-?[d-zD-Z]*$)