Skip to content
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

Make startswith, endswith work with Regex #29790

Merged
merged 17 commits into from
Feb 1, 2019
Prev Previous commit
Next Next commit
Update docstrings
  • Loading branch information
dalum committed Oct 30, 2018
commit 1ff3b90702898872a2901dc53c88b2904753fdd2
12 changes: 8 additions & 4 deletions base/regex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ end
"""
startswith(s::AbstractString, prefix::Regex)

Return `true` if `s` starts with the Regex pattern, `prefix`.
Return `true` if `s` starts with the regex pattern, `prefix`. Note:
dalum marked this conversation as resolved.
Show resolved Hide resolved
the regex version of `occursin` is recommended over `startswith` in
performance critical situations.

See also [`endswith`](@ref).
See also [`occursin`](@ref) and [`endswith`](@ref).

# Examples
```jldoctest
Expand All @@ -202,9 +204,11 @@ end
"""
endswith(s::AbstractString, suffix::Regex)

Return `true` if `s` ends with the Regex pattern, `suffix`.
Return `true` if `s` ends with the regex pattern, `suffix`. Note: the
regex version of `occursin` is recommended over `endswith` in
performance critical situations.

See also [`startswith`](@ref).
See also [`occursin`](@ref) and [`startswith`](@ref).

# Examples
```jldoctest
Expand Down