When using regular expressions in Python, is there any difference between '[^ ]*'
and '\S*'
? Don't they both mean "match zero or more non-whitespace characters"?
Asked
Active
Viewed 39 times
0
![](../../users/profiles/4304123.webp)
Blair Nangle
- 140
- 10
-
3tab/cr/lf and more are also considered whitespace by \s and \S whereas your character class only considers `" "` to match. – Alex K. Nov 05 '15 at 15:07
-
It is not hard to visit [regex101.com](http://regex101.com) and check yourself. Pattern description on the right is usually quite comprehensive. – Wiktor Stribiżew Nov 05 '15 at 15:09