From e92679ce07e8add4a14dd1a09c19159efaed00c9 Mon Sep 17 00:00:00 2001 From: Christian Kurz Date: Thu, 16 Aug 2018 19:45:31 +0200 Subject: [PATCH 1/7] Update regex.jl add `Regex` documentation. (#26919) --- base/regex.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base/regex.jl b/base/regex.jl index 41745eddd2a21..13197e159966c 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -7,6 +7,16 @@ include("pcre.jl") const DEFAULT_COMPILER_OPTS = PCRE.UTF | PCRE.NO_UTF_CHECK | PCRE.ALT_BSUX | PCRE.UCP const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK +""" + Regex(pattern[, flags]) + +A type representing a regular expression. `Regex`-objects can be used to match strings +with [`match`](@ref) or [`matchall`](@ref). + +`Regex` objects can be created using the [`r""`](@ref) string-macro. The +`Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs +to be interpolated. See the documentation of the string-macro for details on flags. +""" mutable struct Regex pattern::String compile_options::UInt32 @@ -81,6 +91,8 @@ listed after the ending quote, to change its behaviour: `\\s`, `\\W`, `\\w`, etc. match based on Unicode character properties. With this option, these sequences only match ASCII characters. +See [`Regex`](@ref) if interpolation is needed. + # Examples ```jldoctest julia> match(r"a+.*b+.*?d\$"ism, "Goodbye,\\nOh, angry,\\nBad world\\n") From a0019adf44d2f938f7d33b7183b40b373a04ed4c Mon Sep 17 00:00:00 2001 From: Christian Kurz Date: Fri, 17 Aug 2018 22:22:53 +0200 Subject: [PATCH 2/7] Update regex.jl dont link to regex docs --- base/regex.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/regex.jl b/base/regex.jl index 13197e159966c..f53a77885a62f 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -13,7 +13,7 @@ const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK A type representing a regular expression. `Regex`-objects can be used to match strings with [`match`](@ref) or [`matchall`](@ref). -`Regex` objects can be created using the [`r""`](@ref) string-macro. The +`Regex` objects can be created using the [`@r_str`](@ref) string-macro. The `Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs to be interpolated. See the documentation of the string-macro for details on flags. """ @@ -91,7 +91,7 @@ listed after the ending quote, to change its behaviour: `\\s`, `\\W`, `\\w`, etc. match based on Unicode character properties. With this option, these sequences only match ASCII characters. -See [`Regex`](@ref) if interpolation is needed. +See `Regex` if interpolation is needed. # Examples ```jldoctest From 56fe6a05b4182fe33a15a6270107236baeba2ee3 Mon Sep 17 00:00:00 2001 From: Christian Kurz Date: Fri, 17 Aug 2018 23:12:57 +0200 Subject: [PATCH 3/7] Update regex.jl removed hyphens --- base/regex.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/regex.jl b/base/regex.jl index f53a77885a62f..c36b43e9ca8ec 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -10,10 +10,10 @@ const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK """ Regex(pattern[, flags]) -A type representing a regular expression. `Regex`-objects can be used to match strings +A type representing a regular expression. `Regex` objects can be used to match strings with [`match`](@ref) or [`matchall`](@ref). -`Regex` objects can be created using the [`@r_str`](@ref) string-macro. The +`Regex` objects can be created using the [`@r_str`](@ref) string macro. The `Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs to be interpolated. See the documentation of the string-macro for details on flags. """ From b8fffc66ae84d07c944516e117132836e6d06989 Mon Sep 17 00:00:00 2001 From: Christian Kurz Date: Sat, 18 Aug 2018 10:09:40 +0200 Subject: [PATCH 4/7] Update regex.jl i seem to like hyphens.... --- base/regex.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/regex.jl b/base/regex.jl index c36b43e9ca8ec..7a392f8388dd3 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -15,7 +15,7 @@ with [`match`](@ref) or [`matchall`](@ref). `Regex` objects can be created using the [`@r_str`](@ref) string macro. The `Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs -to be interpolated. See the documentation of the string-macro for details on flags. +to be interpolated. See the documentation of the string macro for details on flags. """ mutable struct Regex pattern::String From 581a100c623d8323f469af093f17f4d0609af188 Mon Sep 17 00:00:00 2001 From: Christian Kurz Date: Sat, 18 Aug 2018 10:18:38 +0200 Subject: [PATCH 5/7] Update regex.jl removed ref to `matchall` --- base/regex.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/regex.jl b/base/regex.jl index 7a392f8388dd3..384d6ca3dfa21 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -11,7 +11,7 @@ const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK Regex(pattern[, flags]) A type representing a regular expression. `Regex` objects can be used to match strings -with [`match`](@ref) or [`matchall`](@ref). +with [`match`](@ref). `Regex` objects can be created using the [`@r_str`](@ref) string macro. The `Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs From a68c2fbfd1214e03d87bacb523c35fdf8b6ee4b4 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 20 Aug 2018 14:08:04 +0200 Subject: [PATCH 6/7] Update regex.jl --- base/regex.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/regex.jl b/base/regex.jl index 384d6ca3dfa21..557b456198630 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -91,7 +91,7 @@ listed after the ending quote, to change its behaviour: `\\s`, `\\W`, `\\w`, etc. match based on Unicode character properties. With this option, these sequences only match ASCII characters. -See `Regex` if interpolation is needed. +See [`Regex`](@ref) if interpolation is needed. # Examples ```jldoctest From 9ad0e0869b2fc1fefd7e8e74455a5ff774f9c30b Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 20 Aug 2018 18:24:24 +0200 Subject: [PATCH 7/7] undo --- base/regex.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/regex.jl b/base/regex.jl index 557b456198630..384d6ca3dfa21 100644 --- a/base/regex.jl +++ b/base/regex.jl @@ -91,7 +91,7 @@ listed after the ending quote, to change its behaviour: `\\s`, `\\W`, `\\w`, etc. match based on Unicode character properties. With this option, these sequences only match ASCII characters. -See [`Regex`](@ref) if interpolation is needed. +See `Regex` if interpolation is needed. # Examples ```jldoctest