startOfSubject
An anchor that matches at the start of the input string.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
static var startOfSubject: Anchor { get }
This anchor is equivalent to \A
in regex syntax.
An anchor that matches at the start of the input string.
static var startOfSubject: Anchor { get }
This anchor is equivalent to \A
in regex syntax.
import RegexBuilder
struct Anchor
A regex component that matches a specific condition at a particular position in an input string.
static var endOfLine: Anchor { get }
An anchor that matches at the end of a line, including at the end of the input string.
static var endOfSubject: Anchor { get }
An anchor that matches at the end of the input string.
static var endOfSubjectBeforeNewline: Anchor { get }
An anchor that matches at the end of the input string or at the end of the line immediately before the end of the string.
static var firstMatchingPositionInSubject: Anchor { get }
An anchor that matches at the first position of a match in the input string.
static var startOfLine: Anchor { get }
An anchor that matches at the start of a line, including the start of the input string.
static var textSegmentBoundary: Anchor { get }
An anchor that matches at a grapheme cluster boundary.
static var wordBoundary: Anchor { get }
An anchor that matches at a word boundary.
var inverted: Anchor { get }
The inverse of this anchor, which matches at every position that this anchor does not.
var regex: Regex<Substring> { get }