I want to create a Pattern in Java which will return true for this lines:
some_stuff.ABS
hellomynameis.ABS
any_string_or_number.ABS
I tried to use *.ABS as Pattern but it didn’t work..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
FIrst, you would need to match everything till
.ABS, for that you can use adot(.)with 0 or more occurrences(*quantifier). And then to match.ABS, you would need\\.ABS.You can use this: –
Of course, if you just want to match string that ends with
.ABS, thenString.endsWithwould be a better choice. You don’t really need Regex here.