Build, test, and debug regular expressions
This regex matches the number 1234 with optional leading zeros (e.g., 01234, 0001234), ensuring it is not part of a longer digit sequence by requiring a non-digit character or line boundary before and after. The core digits are captured in a named group 'serial' for easy extraction. With global and multiline flags, it scans line-by-line, making it useful for locating serial numbers or IDs in logs, invoices, or configuration files.