how to check the string if the last 7 chars contains numbers or not using regex in java.
[0-9] = will match any digit,
{7} = the length of the digits, so the matched string will be exactly 7 digits long
$ = signifies end of line
so this regex will match any line that ends with 7 digits
a good way to start learning is sites like https://regex101.com/, which explain the whole regex string you input