^ - means that the match will be searched from the beginning of the line, and not from any character. The expression /box/ will match both box-web and home-box-web, and /^box/ only to the first line.
$ - means binding to the end of the line /index\.php/ will match both site.ru/index.php and site.ru/index.php?v=3, the expression /index\.php$/ will correspond only to the first variant.
.+ - any number of characters. Point - any character, combination .+ - one or more any characters.
\. - Since the dot is a special character, in order to mark a dot, it must be escaped with a slash.
\w - any character that can make up the word \w+ - any number of such characters (one or more).
Those. The expression ^.+\.\w+$ covers almost any URL. The sight was originally on expressions of the form hello / index.php.
Regular expressions are special declarative languages. Learning it is not as easy as it may seem at first glance. Its declarative nature does not allow to use the experience and knowledge acquired, say, in imperative programming languages. Therefore, studying it should be patient - this can take time. Quantifiers and special symbols will have to be memorized and to achieve a complete understanding of their work as branching operators and cycles in imperative languages. In exchange, you get a very compact tool for string manipulation.