55
66import gleam/option . { type Option }
77
8+ @ deprecated ( "Please use the gleam_regexp package instead" )
89pub type Regex
910
1011/// The details about a particular match:
1112///
13+ @ deprecated ( "Please use the gleam_regexp package instead" )
1214pub type Match {
1315 Match (
1416 /// The full string of the match.
@@ -20,6 +22,7 @@ pub type Match {
2022
2123/// When a regular expression fails to compile:
2224///
25+ @ deprecated ( "Please use the gleam_regexp package instead" )
2326pub type CompileError {
2427 CompileError (
2528 /// The problem encountered that caused the compilation to fail
@@ -30,6 +33,7 @@ pub type CompileError {
3033 )
3134}
3235
36+ @ deprecated ( "Please use the gleam_regexp package instead" )
3337pub type Options {
3438 Options ( case_insensitive : Bool , multi_line : Bool )
3539}
@@ -52,6 +56,7 @@ pub type Options {
5256/// // -> True
5357/// ```
5458///
59+ @ deprecated ( "Please use the gleam_regexp package instead" )
5560pub fn compile (
5661 pattern : String ,
5762 with options : Options ,
@@ -89,6 +94,7 @@ fn do_compile(
8994/// // ))
9095/// ```
9196///
97+ @ deprecated ( "Please use the gleam_regexp package instead" )
9298pub fn from_string ( pattern : String ) -> Result ( Regex , CompileError ) {
9399 compile ( pattern , Options ( case_insensitive : False , multi_line : False ) )
94100}
@@ -108,6 +114,7 @@ pub fn from_string(pattern: String) -> Result(Regex, CompileError) {
108114/// // -> False
109115/// ```
110116///
117+ @ deprecated ( "Please use the gleam_regexp package instead" )
111118pub fn check ( with regex : Regex , content string : String ) -> Bool {
112119 do_check ( regex , string )
113120}
@@ -126,6 +133,7 @@ fn do_check(regex: Regex, string: String) -> Bool
126133/// // -> ["foo", "32", "4", "9", "0"]
127134/// ```
128135///
136+ @ deprecated ( "Please use the gleam_regexp package instead" )
129137pub fn split ( with regex : Regex , content string : String ) -> List ( String ) {
130138 do_split ( regex , string )
131139}
@@ -186,6 +194,7 @@ fn do_split(regex: Regex, string: String) -> List(String)
186194/// // -> []
187195/// ```
188196///
197+ @ deprecated ( "Please use the gleam_regexp package instead" )
189198pub fn scan ( with regex : Regex , content string : String ) -> List ( Match ) {
190199 do_scan ( regex , string )
191200}
@@ -210,6 +219,7 @@ fn do_scan(regex: Regex, string: String) -> List(Match)
210219/// replace(each: re, in: "a,b-c d+e", with: "/")
211220/// // -> "a/b/c/d/e"
212221/// ```
222+ @ deprecated ( "Please use the gleam_regexp package instead" )
213223@ external ( erlang , "gleam_stdlib" , "regex_replace" )
214224@ external ( javascript , "../gleam_stdlib.mjs" , "regex_replace" )
215225pub fn replace (
0 commit comments