-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Regex
documentation
#28703
add Regex
documentation
#28703
Changes from 3 commits
e92679c
a0019ad
56fe6a0
b8fffc6
581a100
a68c2fb
9ad0e08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,16 @@ include("pcre.jl") | |
const DEFAULT_COMPILER_OPTS = PCRE.UTF | PCRE.NO_UTF_CHECK | PCRE.ALT_BSUX | PCRE.UCP | ||
const DEFAULT_MATCH_OPTS = PCRE.NO_UTF_CHECK | ||
|
||
""" | ||
Regex(pattern[, flags]) | ||
|
||
A type representing a regular expression. `Regex` objects can be used to match strings | ||
with [`match`](@ref) or [`matchall`](@ref). | ||
|
||
`Regex` objects can be created using the [`@r_str`](@ref) string macro. The | ||
`Regex(pattern[, flags])` constructor is usually used if the `pattern` string needs | ||
to be interpolated. See the documentation of the string-macro for details on flags. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You missed the hyphen here :) |
||
""" | ||
mutable struct Regex | ||
pattern::String | ||
compile_options::UInt32 | ||
|
@@ -81,6 +91,8 @@ listed after the ending quote, to change its behaviour: | |
`\\s`, `\\W`, `\\w`, etc. match based on Unicode character properties. With this option, | ||
these sequences only match ASCII characters. | ||
|
||
See `Regex` if interpolation is needed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pushed the update |
||
|
||
# Examples | ||
```jldoctest | ||
julia> match(r"a+.*b+.*?d\$"ism, "Goodbye,\\nOh, angry,\\nBad world\\n") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchall
does not exist anymore.