orsos
August 27, 2021, 11:50am
1
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
jling
August 27, 2021, 11:53am
2
orsos:
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"
orsos
August 27, 2021, 12:08pm
3
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
jling
August 27, 2021, 12:12pm
4
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?
amrods
August 27, 2021, 12:19pm
5
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:
Julia v1.7 Release Notes
========================
New language features
---------------------
* `(; a, b) = x` can now be used to destructure properties `a` and `b` of `x`.
This syntax is equivalent to `a = getproperty(x, :a); b = getproperty(x, :b)` ([#39285]).
* Implicit multiplication by juxtaposition is now allowed for radical symbols (e.g. `x√y` and `x∛y`) ([#40173]).
* The short-circuiting operators `&&` and `||` can now be dotted to participate in broadcast fusion
as `.&&` and `.||` ([#39594]).
* `⫪` (U+2AEA, `\Top`, `\downvDash`) and `⫫` (U+2AEB, `\Bot`, `\upvDash`, `\indep`)
may now be used as binary operators with comparison precedence ([#39403]).
* Repeated semicolons can now be used inside array concatenation expressions to separate dimensions
of an array, with the number of semicolons specifying the dimension. Just as a single semicolon
in `[A; B]` has always described concatenating in the first dimension (vertically), now two
semicolons `[A;; B]` do so in the second dimension (horizontally), three semicolons `;;;` in the
third, and so on ([#33697]).
* A backslash (`\`) before a newline inside a string literal now removes the newline while also
respecting indentation. This can be used to split up long strings without newlines into multiple
This file has been truncated. show original
There’s this line:
ismatch(regex, str)
has been deprecated in favor of occursin(regex, str)
4 Likes
saikhu
March 8, 2022, 12:24am
6
try occursin() rather then ismatch()
1 Like