# MethodError: no method matching findall(::Regex, ::String)

**URL:** <https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468>\
**Category:** General Usage\
**Tags:** strings\
**Created:** [August 7, 2020, 12:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468 "2020-08-07T00:43:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMval](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bmval/32/7647_2.png) [@BMval](https://discourse.julialang.org/u/BMval)\
**Post date:** [August 7, 2020, 12:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468/1 "2020-08-07T00:43:23Z")

</div>

Would you help me?  
Is there any way, how to use function findall(::Regex,::String) in Julia ver1.1.1

Thank you in advance.  
Best

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [August 7, 2020, 3:16am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468/2 "2020-08-07T03:16:02Z")

</div>

It looks like that method was added in a later version of Julia. Off the top of my head, I’m not sure how you would duplicate the behavior of `findall(::Regex, ::String)` in Julia v1.1.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 7, 2020, 6:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468/3 "2020-08-07T06:43:16Z")

</div>

Here’s the result of `@edit findall(r"a", "aabbcc")` in Julia 1.4.2:

```julia
function findall(t::Union{AbstractString,Regex}, s::AbstractString; overlap::Bool=false)
    found = UnitRange{Int}[]
    i, e = firstindex(s), lastindex(s)
    while true
        r = findnext(t, s, i)
        isnothing(r) && break
        push!(found, r)
        j = overlap || isempty(r) ? first(r) : last(r)
        j > e && break
        @inbounds i = nextind(s, j)
    end
    return found
end

```

See if this runs in 1.1 or if it doesn’t because it relies on something introduced in a later version if it’s easy to tweak.

Also I would encourage you to switch to the latest Julia version - while 1.0.5 is the LTS version which some users might need, there isn’t usually a good reason to use an outdated non-LTS version over the current version.
