Skip to content

Commit e802519

Browse files
Add 'See also' sections to regex function docstring (#59744)
1 parent a817940 commit e802519

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

base/regex.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Return `true` if `s` starts with the regex pattern, `prefix`.
324324
`match_option` to PCRE. If compile time is amortized,
325325
`occursin(r"^...", s)` is faster than `startswith(s, r"...")`.
326326
327-
See also [`occursin`](@ref) and [`endswith`](@ref).
327+
See also [`occursin`](@ref), [`endswith`](@ref), [`match`](@ref)
328328
329329
!!! compat "Julia 1.2"
330330
This method requires at least Julia 1.2.
@@ -356,7 +356,7 @@ Return `true` if `s` ends with the regex pattern, `suffix`.
356356
`match_option` to PCRE. If compile time is amortized,
357357
`occursin(r"...\$", s)` is faster than `endswith(s, r"...")`.
358358
359-
See also [`occursin`](@ref) and [`startswith`](@ref).
359+
See also [`occursin`](@ref), [`startswith`](@ref), [`match`](@ref)
360360
361361
!!! compat "Julia 1.2"
362362
This method requires at least Julia 1.2.
@@ -421,6 +421,9 @@ julia> m.match
421421
julia> match(rx, "cabac", 3) === nothing
422422
true
423423
```
424+
# See also
425+
[`eachmatch`](@ref), [`occursin`](@ref), [`findfirst`](@ref)
426+
424427
"""
425428
function match end
426429

@@ -558,6 +561,9 @@ julia> count(r"a(.)a", "cabacabac", overlap=true)
558561
julia> count(r"a(.)a", "cabacabac")
559562
2
560563
```
564+
# See also
565+
[`eachmatch`](@ref), [`occursin`](@ref), [`findall`](@ref)
566+
561567
"""
562568
function count(t::Union{AbstractChar,AbstractString,AbstractPattern}, s::AbstractString; overlap::Bool=false)
563569
n = 0
@@ -789,6 +795,9 @@ julia> collect(eachmatch(rx, "a1a2a3a", overlap = true))
789795
RegexMatch("a2a")
790796
RegexMatch("a3a")
791797
```
798+
# See also
799+
[`match`](@ref), [`findall`](@ref), [`count`](@ref)
800+
792801
"""
793802
eachmatch(re::Regex, str::AbstractString; overlap = false) =
794803
RegexMatchIterator(re, str, overlap)

0 commit comments

Comments
 (0)