# Ismatch not defined error

**URL:** <https://discourse.julialang.org/t/ismatch-not-defined-error/67096>\
**Category:** New to Julia\
**Created:** [August 27, 2021, 11:50am UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096 "2021-08-27T11:50:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![orsos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/orsos/32/28624_2.png) [@orsos](https://discourse.julialang.org/u/orsos)\
**Post date:** [August 27, 2021, 11:50am UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/1 "2021-08-27T11:50:10Z")

</div>

following function  
directory\_images = filter(x → ismatch(r"/.(jpg|png|gif){1}$"i, x), directory\_files);

returns ismatch not defined error.  
do i need a specific package for ismatch

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 27, 2021, 11:53am UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/2 "2021-08-27T11:53:27Z")

</div>

> [@orsos](#):
>
> ismatch

can you point us to the docs that showed you this?

do you just want:

```julia
julia> filter(endswith(r"(jpg|png|gif)"), ["a.jpg", "b.xml", "c.png"])
2-element Vector{String}:
 "a.jpg"
 "c.png"

```

---

<div class="post-metadata">

**Author:** ![orsos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/orsos/32/28624_2.png) [@orsos](https://discourse.julialang.org/u/orsos)\
**Post date:** [August 27, 2021, 12:08pm UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/3 "2021-08-27T12:08:16Z")

</div>

hi,  
seams to work ok.  
was following a tutorial where ismatch function is used. (also info functions gives the same result)  
[https://www.packtpub.com/product/hands-on-computer-vision-with-julia/9781788998796](https://www.packtpub.com/product/hands-on-computer-vision-with-julia/9781788998796)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 27, 2021, 12:12pm UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/4 "2021-08-27T12:12:38Z")

</div>

```julia

Publication date:
    June 2018 

```

that’s a bit too old since 1.0 was released that year so a lot of things in there probably is pre-1.0?

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [August 27, 2021, 12:19pm UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/5 "2021-08-27T12:19:56Z")

</div>

I think Julia 0.7 was meant to be a bridge between pre 1.0 code and 1+ code. I’m not sure if you would get a deprecation warning for `ismatch`, but I found this:

> <https://github.com/JuliaLang/julia/blob/57ce0e66e9490dcfa01e1e1789fc07bdcac157be/HISTORY.md>

There’s this line:

> `ismatch(regex, str)` has been deprecated in favor of `occursin(regex, str)`

---

<div class="post-metadata">

**Author:** ![saikhu](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@saikhu](https://discourse.julialang.org/u/saikhu)\
**Post date:** [March 8, 2022, 12:24am UTC](https://discourse.julialang.org/t/ismatch-not-defined-error/67096/6 "2022-03-08T00:24:00Z")

</div>

try occursin() rather then ismatch()
