Skip to content

Commit

Permalink
doc: clean up some example regex expressions (#26931)
Browse files Browse the repository at this point in the history
Remove some unnecessary parts of regex expressions used as examples in
the docs.
  • Loading branch information
mbeltagy authored Feb 14, 2024
1 parent a19fbac commit 8eaf83c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/src/manual/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ of the substring that matches, but perhaps we want to capture any non-blank text
character. We could do the following:

```jldoctest
julia> m = match(r"^\s*(?:#\s*(.*?)\s*$|$)", "# a comment ")
julia> m = match(r"^\s*(?:#\s*(.*?)\s*$)", "# a comment ")
RegexMatch("# a comment ", 1="a comment")
```

Expand Down Expand Up @@ -981,10 +981,10 @@ x Tells the regular expression parser to ignore most whitespace
For example, the following regex has all three flags turned on:

```jldoctest
julia> r"a+.*b+.*?d$"ism
r"a+.*b+.*?d$"ims
julia> r"a+.*b+.*d$"ism
r"a+.*b+.*d$"ims
julia> match(r"a+.*b+.*?d$"ism, "Goodbye,\nOh, angry,\nBad world\n")
julia> match(r"a+.*b+.*d$"ism, "Goodbye,\nOh, angry,\nBad world\n")
RegexMatch("angry,\nBad world")
```

Expand Down

0 comments on commit 8eaf83c

Please sign in to comment.