Like many other regular expression engines, the Java regex engine does not allow a variable-length text without an obvious maximum length match in the lookbehind regex pattern. This means that we cannot use the * or + quantifiers in a lookbehind pattern. However, the Java regex engine allows for limited or finite repetition in a lookbehind regex. This gives us a workaround for doing so in Java regular expressions by using limiting quantifiers in lookbehind expressions.
This means that we cannot use the following lookbehind regex to check filenames ending with extensions:
However, we could change the preceding pattern to the following with a finite repetition, and now this ...