Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »
Mike Chelen
Regexp Tutorial - Character Classes or Character Sets - http://www.regular-expressions.info/charcla...
"Negated Character Classes: Typing a caret after the opening square bracket will negate the character class. The result is that the character class will match any character that is not in the character class. Unlike the dot, negated character classes also match (invisible) line break characters. It is important to remember that a negated character class still must match a character. q[^u] does not mean: "a q not followed by a u". It means: "a q followed by a character that is not a u". It will not match the q in the string Iraq. It will match the q and the space after the q in Iraq is a country. Indeed: the space will be part of the overall match, because it is the "character that is not a u" that is matched by the negated character class in the above regexp. If you want the regex to match the q, and only the q, in both strings, you need to use negative lookahead: q(?!u). But we will get to that later." - Mike Chelen from Bookmarklet
Other ways to read this feed:Feed readerFacebook