It is called a regular expression and it is trying to match$_ to the pattern. This looking into $_ for:

Code

/ start of regex \.? zero or one literal dot (?:.*\.)+ a group occurring one of more time (see below) (.*) a capture group capturing any number of any characters until the end of the line / end of regex

The first group consists of: any number of any characters (except new line) followed by a literal dot.

Overall, this seems to be looking for file and directory names and trying to capture the extension.