Skip to content

Commit 7e37d2f

Browse files
committed
add examples and fix md linting
1 parent 953ec6f commit 7e37d2f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ impl PyRegex {
7272
/// function and returns all matched strings in a list, if no matches it
7373
/// returns a empty list
7474
///
75+
/// # Example (python)
76+
/// ```python
77+
/// >>> a = mathes(r"n[o|0]*b", "Dont say noob say n00b or the bot will ban u")
78+
/// >>> a
79+
/// [(9,13),(18,22)]
80+
/// ```
81+
///
7582
/// Args:
7683
/// other:
7784
/// The other string to be matched against the compiled regex.
@@ -130,7 +137,7 @@ fn list_captures(capture: regex::Captures) ->Vec<Option<String>> {
130137
/// Function that given a `regex_pattern` and an input `input_str` returns a
131138
/// vector of tuples that contain (start_match, end_match+1):
132139
/// # Example (python)
133-
/// ```bash
140+
/// ```python
134141
/// >>> a = mathes(r"n[o|0]*b", "Dont say noob say n00b or the bot will ban u")
135142
/// >>> a
136143
/// [(9,13),(18,22)]

0 commit comments

Comments
 (0)