---
title: "dotMatchesNewlines(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/regex/dotmatchesnewlines(_:)"
---

# dotMatchesNewlines(_:)

Returns a regular expression where the “any” metacharacter (.) also matches against the start and end of a line.

## Declaration

```swift
func dotMatchesNewlines(_ dotMatchesNewlines: Bool = true) -> Regex<Regex<Output>.RegexOutput>
```

## Parameters

- `dotMatchesNewlines`: A Boolean value indicating whether . should match a newline character.

## Return Value

Return Value The modified regular expression.
