DEV Community


Answer: Regular Expressions and negating a whole character group [duplicate]

boyukbas profile image baris ・1 min read

Nice thread about regex

Use negative lookahead:


UPDATE: In the comments below, I stated that this approach is slower than the one given in Peter's answer. I've run some tests since then, and found that it's really slightly faster. However, the reason to prefer this technique over the other is not speed…

Discussion (0)

Editor guide