I have a string which can be any string, and I want to single it out if is ends in exactly two "s"
for example, "foo", "foos", "foosss", should all return false but "fooss" and "barss" should return true
The problem is if I use .*s{2}
for a string like "foosss", java sees "foos" as the .*
and "ss" as the s{2}
And if I use .*?s{2}
for "foosss" java will see "foo" as the .*
for a bit, which is what I want, but once it checks the rest of the string to see if it matches s{2}
and it fails, it iterates to the next try
It's important that the beginning string can contain the letter "s", too. "sometexts" and "sometextsss" should return false but "sometextss" should return true