The engine matches the Unicode whitespace class rather than a literal space, which is what separates it from a manual find-and-replace. The set is enumerable and was checked rather than assumed.
- ASCII whitespace
- U+0020 space, U+0009 tab, U+000A line feed, U+000D carriage return, U+000B vertical tab, U+000C form feed.
- Non-breaking spaces
- U+00A0 and U+202F. Visually indistinguishable from an ordinary space and the usual cause of a failed exact match.
- The U+2000 to U+200A block
- En quad through hair space, including figure space U+2007 and punctuation space U+2008, which appear in numeric and tabular output.
- U+205F medium mathematical space
- Produced by mathematical typesetting and carried through when that output is copied as text.
- U+1680 and U+3000
- Ogham space mark and the ideographic space, the latter being standard in Chinese, Japanese and Korean text and a full character wide.
- U+2028 and U+2029
- Line separator and paragraph separator. Both are whitespace and both are removed, so the output is a single line.
- U+FEFF byte-order mark
- Classed as whitespace by the matching rule, so a stranded BOM is removed here as a side effect rather than by design.