Test, validate and match regular expressions
This regular expression matches non-zero integers, both positive and negative, that do not contain leading zeros. It enforces an optional plus or minus sign at the beginning, followed by a single digit from 1 to 9, and then any number of trailing digits. Using the global and multiline flags, it evaluates each line of a multiline string independently to find all valid matches. Note that this pattern deliberately fails to match a standalone '0' or numbers with leading zeros.