-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add Documentation to RegexMatch and keys(::RegexMatch) #40486
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
Conversation
* Added documentation for RegexMatch and keys(::RegexMatch) * Updated the manual * Fix trailing whitespace
base/regex.jl
Outdated
| julia> hr, min, ampm = m | ||
| RegexMatch("11:30", hour="11", minute="30", 3=nothing) |
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.
| julia> hr, min, ampm = m | |
| RegexMatch("11:30", hour="11", minute="30", 3=nothing) | |
| julia> hr, min, ampm = m; |
base/regex.jl
Outdated
| """ | ||
| keys(m::RegexMatch) -> Vector | ||
| Returns a vector of keys for all capture groups of the underlying regex. |
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.
| Returns a vector of keys for all capture groups of the underlying regex. | |
| Return a vector of keys for all capture groups of the underlying regex. |
base/regex.jl
Outdated
| Returns a vector of keys for all capture groups of the underlying regex. | ||
| A key is included even if the capture group fails to match. | ||
| That is, `idx` will be in the return value even if `m.captures[idx] == nothing`. |
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.
| That is, `idx` will be in the return value even if `m.captures[idx] == nothing`. | |
| That is, `idx` will be in the return value even if `m[idx] == nothing`. |
|
@fredrikekre thanks for the review! Just pushed new commit accepting all suggestions. |
|
A test failed but I'm pretty sure it's unrelated to the PR. |
Fixes #40347. I went ahead and added documentation for the the RegexMatch type as well. I also updated the manual to destructure on m rather than m.captures.
Sorry about the second PR. I had whitespace issues in the old PR (#40485) and accidentally made a mess of the the commit graph trying to fix it, so I squashed those commits and opened a new PR.