Skip to content

Commit 3175901

Browse files
eksperimentaljosevalim
authored andcommitted
Align Regex dotall modifier to PCRE2 (#14792)
1 parent a2baac9 commit 3175901

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/elixir/lib/regex.ex

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# SPDX-FileCopyrightText: 2012 Plataformatec
44

55
defmodule Regex do
6+
# TODO: Remove the "Starting from Erlang/OTP 28" part in the Modifiers'
7+
# section once Erlang/OTP 28+ is exclusively supported.
68
@moduledoc ~S"""
79
Provides regular expressions for Elixir.
810
@@ -76,9 +78,16 @@ defmodule Regex do
7678
7779
* `:caseless` (i) - adds case insensitivity
7880
79-
* `:dotall` (s) - causes dot to match newlines and also set newline to
80-
anycrlf; the new line setting can be overridden by setting `(*CR)` or
81-
`(*LF)` or `(*CRLF)` or `(*ANY)` according to `:re` documentation
81+
* `:dotall` (s) - causes dot to match newlines and also sets newline to
82+
`(*ANYCRLF)`.\
83+
The new line setting, as described in the [`:re` documentation](`:re`),
84+
can be overridden by starting the regular expression pattern with:
85+
* `(*CR)` - carriage return
86+
* `(*LF)` - line feed
87+
* `(*CRLF)` - carriage return, followed by line feed
88+
* `(*ANYCRLF)` - any of the three above
89+
* `(*ANY)` - all Unicode newline sequences
90+
* _Starting from Erlang/OTP 28, `(*NUL)` - the NUL character (binary zero)_
8291
8392
* `:multiline` (m) - causes `^` and `$` to mark the beginning and end of
8493
each line; use `\A` and `\z` to match the end or beginning of the string

0 commit comments

Comments
 (0)