Test, validate and match regular expressions
This regular expression matches numbers, including integers and decimal numbers, with an optional leading minus sign for negative values. It captures whole numbers like 42 and -7, as well as floating-point numbers like 3.14 and -0.5, but does not match exponents or numbers without a leading digit before the decimal point. The global flag allows it to find all matches in a text, and the multiline flag makes anchors like ^ and $ work per line, but since no anchors are used, it primarily affects line-based searching. It is useful for extracting numeric values from strings, logs, or user input.