Skip to content

Commit

Permalink
doc: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng-Yuan-Lai committed Jan 15, 2025
1 parent 4e13bb0 commit c832494
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion datafusion/functions/src/regex/regexpcount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use std::sync::Arc;
+---------------------------------------------------------------+
```"#,
standard_argument(name = "str", prefix = "String"),
standard_argument(name = "Regexp", prefix = "Regular"),
standard_argument(name = "regexp", prefix = "Regular"),
argument(
name = "start",
description = "- **start**: Optional start position (the first position is 1) to search for the regular expression. Can be a constant, column, or function."
Expand Down
6 changes: 1 addition & 5 deletions datafusion/functions/src/regex/regexplike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ SELECT regexp_like('aBc', '(b|d)', 'i');
Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs)
"#,
standard_argument(name = "str", prefix = "String"),
standard_argument(name = "Regexp", prefix = "Regular"),
argument(
name = "start",
description = "- **start**: Optional start position (the first position is 1) to search for the regular expression. Can be a constant, column, or function."
),
standard_argument(name = "regexp", prefix = "Regular"),
argument(
name = "flags",
description = r#"Optional regular expression flags that control the behavior of the regular expression. The following flags are supported:
Expand Down
27 changes: 14 additions & 13 deletions datafusion/functions/src/regex/regexpmatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,26 @@ use std::sync::Arc;
description = "Returns the first [regular expression](https://docs.rs/regex/latest/regex/#syntax) matches in a string.",
syntax_example = "regexp_match(str, regexp[, flags])",
sql_example = r#"```sql
> select regexp_match('Köln', '[a-zA-Z]ö[a-zA-Z]{2}');
+---------------------------------------------------------+
| regexp_match(Utf8("Köln"),Utf8("[a-zA-Z]ö[a-zA-Z]{2}")) |
+---------------------------------------------------------+
| [Köln] |
+---------------------------------------------------------+
SELECT regexp_match('aBc', '(b|d)', 'i');
+---------------------------------------------------+
| regexp_match(Utf8("aBc"),Utf8("(b|d)"),Utf8("i")) |
+---------------------------------------------------+
| [B] |
+---------------------------------------------------+
> select regexp_match('Köln', '[a-zA-Z]ö[a-zA-Z]{2}');
+---------------------------------------------------------+
| regexp_match(Utf8("Köln"),Utf8("[a-zA-Z]ö[a-zA-Z]{2}")) |
+---------------------------------------------------------+
| [Köln] |
+---------------------------------------------------------+
SELECT regexp_match('aBc', '(b|d)', 'i');
+---------------------------------------------------+
| regexp_match(Utf8("aBc"),Utf8("(b|d)"),Utf8("i")) |
+---------------------------------------------------+
| [B] |
+---------------------------------------------------+
```
Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs)
"#,
standard_argument(name = "str", prefix = "String"),
argument(
name = "regexp",
description = "Regular expression to match against. Can be a constant, column, or function."
description = "Regular expression to match against.
Can be a constant, column, or function."
),
argument(
name = "flags",
Expand Down
19 changes: 12 additions & 7 deletions datafusion/functions/src/regex/regexpreplace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,24 @@ SELECT regexp_replace('aBc', '(b|d)', 'Ab\\1a', 'i');
Additional examples can be found [here](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/regexp.rs)
"#,
standard_argument(name = "str", prefix = "String"),
standard_argument(name = "replacement", prefix = "Replacement string"),
argument(
name = "regexp",
description = "Regular expression to match against. Can be a constant, column, or function."
description = "Regular expression to match against.
Can be a constant, column, or function."
),
argument(
name = "replacement",
description = "Replacement string expression to operate on. Can be a constant, column, or function, and any combination of operators."
),
argument(
name = "flags",
description = r#"Optional regular expression flags that control the behavior of the regular expression. The following flags are supported:
- **i**: case-insensitive: letters match both upper and lower case
- **m**: multi-line mode: ^ and $ match begin/end of line
- **s**: allow . to match \n
- **R**: enables CRLF mode: when multi-line mode is enabled, \r\n is used
- **U**: swap the meaning of x* and x*?"#
- **g**: (global) Search globally and don't return after the first match
- **i**: case-insensitive: letters match both upper and lower case
- **m**: multi-line mode: ^ and $ match begin/end of line
- **s**: allow . to match \n
- **R**: enables CRLF mode: when multi-line mode is enabled, \r\n is used
- **U**: swap the meaning of x* and x*?"#
)
)]
#[derive(Debug)]
Expand Down

0 comments on commit c832494

Please sign in to comment.