Test, validate and match regular expressions
This PCRE2 pattern captures a phone number-like sequence of at least 5 digits and hyphens appearing at the end of a sentence or line. It skips over any preceding text (.*), a whitespace, and one word ([^\s]+\s), then stores the trailing number in capture group 1. With global and multiline flags, it processes each line independently and finds all occurrences. Ideal for phone verification tasks where numbers like 555-123-4567 need to be extracted from free-form text.