Hi I am struggling with regex in Java for those scenarios:
String testtt = "aha.comment.1.app"; // should pass
String testtt2 = "aha.comment1.app"; // should fail
My logical proposition was:
String regex = ".\\.[0-9]\\..+";
but it's not working...
I want to have a regex that will just check if in the whole string there is a digit/number wrapped with two dots e.g .1., .22. and also the characters can stay before and after.
other test scenarios:
a.1.b.c.d.2.a // should pass
a.2.b.c2.a.1. // should not pass
any hints?
of course i am using testtt.matches(regex)