<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/RegexBuilder/Anchor/endOfLine",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "RegexBuilder"
    ],
    "preciseIdentifier" : "s:12RegexBuilder6AnchorV9endOfLineACvpZ"
  },
  "title" : "endOfLine"
}
-->

# endOfLine

An anchor that matches at the end of a line, including at the end of
the input string.

```
static var endOfLine: Anchor { get }
```

## Discussion

This anchor is equivalent to `$` in regex syntax when the `m` option
has been enabled or `anchorsMatchLineEndings(true)` has been called.

For example, the following regexes are all equivalent:

- `Regex { Anchor.endOfLine }`
- `/(?m)$/` or `/(?m:$)/`
- `/$/.anchorsMatchLineEndings(true)`

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)