by pietzcker » Sun Sep 14, 2008 4:15 am
Nope. Inside a character class, escaped characters don't lose their meaning - [\r\n] means "match a CR or an LF". However, most special characters (outside of character classes) have a different meaning inside character classes (e.g., ^, -, [, ], (, ) etc.). A character class does match a single character.
So [^\d\s] means "Match any character that is neither a digit nor a whitespace character". [\D\S], however, means "Match any character that is (not a digit) or (not a whitespace)" which is true for every single character imaginable - "8" is not a whitespace character, so it matches. " " is not a digit, so it matches, too. "x" is neither, so it matches, too. So UE's regex engine is wrong when it matches "x" but not "8".