Test, validate and match regular expressions
Matches signed numbers in two alternated forms: decimal numbers like -3.14 (optional minus sign, digits, a dot, and digits) anchored at the start of a string, or integers like -42 (optional minus sign and digits) anchored at the end. With the global flag, it's useful for extracting or validating numeric values from text, such as parsing user input or filtering numeric data.