5
5
6
6
import gleam/option . { type Option }
7
7
8
+ @ deprecated ( "Please use the gleam_regexp package instead" )
8
9
pub type Regex
9
10
10
11
/// The details about a particular match:
11
12
///
13
+ @ deprecated ( "Please use the gleam_regexp package instead" )
12
14
pub type Match {
13
15
Match (
14
16
/// The full string of the match.
@@ -20,6 +22,7 @@ pub type Match {
20
22
21
23
/// When a regular expression fails to compile:
22
24
///
25
+ @ deprecated ( "Please use the gleam_regexp package instead" )
23
26
pub type CompileError {
24
27
CompileError (
25
28
/// The problem encountered that caused the compilation to fail
@@ -30,6 +33,7 @@ pub type CompileError {
30
33
)
31
34
}
32
35
36
+ @ deprecated ( "Please use the gleam_regexp package instead" )
33
37
pub type Options {
34
38
Options ( case_insensitive : Bool , multi_line : Bool )
35
39
}
@@ -52,6 +56,7 @@ pub type Options {
52
56
/// // -> True
53
57
/// ```
54
58
///
59
+ @ deprecated ( "Please use the gleam_regexp package instead" )
55
60
pub fn compile (
56
61
pattern : String ,
57
62
with options : Options ,
@@ -89,6 +94,7 @@ fn do_compile(
89
94
/// // ))
90
95
/// ```
91
96
///
97
+ @ deprecated ( "Please use the gleam_regexp package instead" )
92
98
pub fn from_string ( pattern : String ) -> Result ( Regex , CompileError ) {
93
99
compile ( pattern , Options ( case_insensitive : False , multi_line : False ) )
94
100
}
@@ -108,6 +114,7 @@ pub fn from_string(pattern: String) -> Result(Regex, CompileError) {
108
114
/// // -> False
109
115
/// ```
110
116
///
117
+ @ deprecated ( "Please use the gleam_regexp package instead" )
111
118
pub fn check ( with regex : Regex , content string : String ) -> Bool {
112
119
do_check ( regex , string )
113
120
}
@@ -126,6 +133,7 @@ fn do_check(regex: Regex, string: String) -> Bool
126
133
/// // -> ["foo", "32", "4", "9", "0"]
127
134
/// ```
128
135
///
136
+ @ deprecated ( "Please use the gleam_regexp package instead" )
129
137
pub fn split ( with regex : Regex , content string : String ) -> List ( String ) {
130
138
do_split ( regex , string )
131
139
}
@@ -186,6 +194,7 @@ fn do_split(regex: Regex, string: String) -> List(String)
186
194
/// // -> []
187
195
/// ```
188
196
///
197
+ @ deprecated ( "Please use the gleam_regexp package instead" )
189
198
pub fn scan ( with regex : Regex , content string : String ) -> List ( Match ) {
190
199
do_scan ( regex , string )
191
200
}
@@ -210,6 +219,7 @@ fn do_scan(regex: Regex, string: String) -> List(Match)
210
219
/// replace(each: re, in: "a,b-c d+e", with: "/")
211
220
/// // -> "a/b/c/d/e"
212
221
/// ```
222
+ @ deprecated ( "Please use the gleam_regexp package instead" )
213
223
@ external ( erlang , "gleam_stdlib" , "regex_replace" )
214
224
@ external ( javascript , "../gleam_stdlib.mjs" , "regex_replace" )
215
225
pub fn replace (
0 commit comments