Contents

anchorsMatchLineEndings(_:)

Returns a regular expression where the start and end of input anchors (^ and $) also match against the start and end of a line.

Declaration

func anchorsMatchLineEndings(_ matchLineEndings: Bool = true) -> Regex<Regex<Output>.RegexOutput>

Parameters

  • matchLineEndings:

    A Boolean value indicating whether ^ and $ should match the start and end of lines, respectively.

Return Value

The modified regular expression.

Discussion

This method corresponds to applying the m option in regex syntax. For this behavior in the RegexBuilder syntax, see Anchor.startOfLine, Anchor.endOfLine, Anchor.startOfSubject, and Anchor.endOfSubject.