Options for Swift Regular Expressions


OptionDescriptionBackend valuePortable value
anchorsMatchLineEndingsthe start and end of input anchors (^ and $) also match against the start and end of a line.anchorsMatchLineEndings(not portable)
asciiOnlyCharacterClassesonly ASCII characters when matching character classes.asciiOnlyCharacterClasses(not portable)
asciiOnlyDigitsonly ASCII characters as digitsasciiOnlyDigits(not portable)
asciiOnlyWhitespaceonly ASCII characters as space charactersasciiOnlyWhitespace(not portable)
asciiOnlyWordCharactersonly ASCII characters as word charactersasciiOnlyWordCharacters(not portable)
dotMatchesNewlinesthe “any” metacharacter (.) also matches against the start and end of a line.dotMatchesNewlines(not portable)
ignoresCaseignores case when matchingignoresCase(not portable)
unicodeMatchingSemanticsuse Unicode scalar matching sematicsunicodeMatchingSemantics(not portable)