Skip to content

Commit

Permalink
xref and doctest for regexmatch and occursin (#49911)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored May 22, 2023
1 parent a6ad9ea commit 3b84b08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/regex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ abstract type AbstractMatch end
"""
RegexMatch <: AbstractMatch
A type representing a single match to a `Regex` found in a string.
A type representing a single match to a [`Regex`](@ref) found in a string.
Typically created from the [`match`](@ref) function.
The `match` field stores the substring of the entire matched string.
Expand Down
11 changes: 11 additions & 0 deletions base/strings/search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,17 @@ The returned function is of type `Base.Fix2{typeof(occursin)}`.
!!! compat "Julia 1.6"
This method requires Julia 1.6 or later.
# Examples
```jldoctest
julia> search_f = occursin("JuliaLang is a programming language");
julia> search_f("JuliaLang")
true
julia> search_f("Python")
false
```
"""
occursin(haystack) = Base.Fix2(occursin, haystack)

Expand Down

0 comments on commit 3b84b08

Please sign in to comment.