TechnologiesFoundation, System & Concurrency

_StringProcessing cross-import overlay

iOSmacOStvOSwatchOSvisionOS

_StringProcessing provides the regular-expression engine support that backs Swift's Regex type. Use Regex to match patterns against strings, and read the captures through AnyRegexOutput, a type-erased output that represents dynamic match results when the shape of a pattern is not known at compile time. Build and compose patterns by conforming to RegexComponent or CustomConsumingRegexComponent, and tune matching with values such as RegexSemanticLevel, RegexRepetitionBehavior, and RegexWordBoundaryKind. The framework is available on iOS, macOS, tvOS, watchOS, and visionOS.

Regular Expressions 2

The core regex type and its type-erased dynamic match output.

  • St
    RegexiOS 16.0+
    A regular expression.
  • St
    AnyRegexOutputiOS 16.0+
    The type-erased, dynamic output of a regular expression match.

Building Patterns 2

Protocols for composing patterns and contributing custom matching logic.

  • Pr
    RegexComponentiOS 16.0+
    A type that represents a regular expression.
  • Pr
    CustomConsumingRegexComponentiOS 16.0+
    A protocol for types that provide custom consuming logic to participate in regex matching.

Matching Behavior 3

Values that tune how patterns are matched against input.

  • St
    RegexSemanticLeveliOS 16.0+
    A semantic level to use during regex matching.
  • St
    RegexRepetitionBehavioriOS 16.0+
    Specifies how much to attempt to match when using a quantifier.
  • St
    RegexWordBoundaryKindiOS 16.0+
    A word boundary algorithm to use during regex matching.

Extends 4

BidirectionalCollectionRangeReplaceableCollectionCollectionStringProtocol
← Foundation, System & Concurrency