Test, validate and match regular expressions
This PCRE2 regex matches isolated 6 to 7-digit numbers, optionally followed by 1 to 2-digit suffixes separated by non-alphanumeric characters (excluding colons). It uses negative lookarounds to prevent matching numbers embedded within longer digit sequences. It is ideal for extracting specific ticket IDs, card numbers, or document references from email text, accommodating formats like '123456-01' or '1234567/2'.