<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/RegexComponent/anyNonNewline",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:17_StringProcessing14RegexComponentP0C7BuilderAD14CharacterClassVRszrlE13anyNonNewlineAFvpZ"
  },
  "title" : "anyNonNewline"
}
-->

# anyNonNewline

A character class that matches any element that isn’t a newline.

```
static var anyNonNewline: CharacterClass { get }
```

## Discussion

This character class is unaffected by the `dotMatchesNewlines()` method.
To match any character, including newlines, see [`any`](/documentation/Swift/RegexComponent/any).

This character class is equivalent to the regex syntax “dot”
metacharacter with single-line mode disabled: `(?-s:.)`.

---

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)