Test, validate and match regular expressions
This regular expression is designed to match PHP-style variables, which begin with a dollar sign ($) followed by non-whitespace characters. It captures the variable name without the dollar sign into a capturing group. Using the global (g) flag allows it to find all occurrences within a given string. It is useful for extracting variable names from code snippets or templating languages.