so give it a regex `it.matches(Regex("\.[abc]\."))...
# getting-started
k
so give it a regex
it.matches(Regex("\.[abc]\."))
👍 2
n
That might still not do what is expected: this is the same as
Regex(".[abc].")
. If you want the
.
to be matched literally, use
Regex("""\.[abc]\.""")
or
Regex("\\.[abc]\\.")
👍 2
k
intelliJ lets you test it, so just give it a quick spin
b
Thank you both. I 've done some "spins" and ended with a pattern like ".+abc*.+" . The key point for me was ' Regex("foo") '. @nkiesel Your reply made a point! 👍