word

A character class that matches any element that is a “word character”.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
static var word: CharacterClass { get }

This character class is equivalent to \w in regex syntax.