Ismatch not defined error

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

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

do you just want:

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

hi,
seams to work ok.
was following a tutorial where ismatch function is used. (also info functions gives the same result)


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?

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:

There’s this line:

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

4 Likes

try occursin() rather then ismatch()