We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
findall
1 parent e09066f commit 10def15Copy full SHA for 10def15
base/regex.jl
@@ -340,6 +340,23 @@ matching sequence is found, like the return value of [`findnext`](@ref).
340
341
If `overlap=true`, the matching sequences are allowed to overlap indices in the
342
original string, otherwise they must be from disjoint character ranges.
343
+
344
+# Examples
345
+```jldoctest
346
+julia> findall("a", "apple")
347
+1-element Array{UnitRange{Int64},1}:
348
+ 1:1
349
350
+julia> findall("nana", "banana")
351
352
+ 3:6
353
354
+julia> findall("a", "banana")
355
+3-element Array{UnitRange{Int64},1}:
356
+ 2:2
357
+ 4:4
358
+ 6:6
359
+```
360
"""
361
function findall(t::Union{AbstractString,Regex}, s::AbstractString; overlap::Bool=false)
362
found = UnitRange{Int}[]
0 commit comments