http://www.perlmonks.org?node_id=963818


in reply to Re^4: pcre regex
in thread pcre regex

This might do what yo uwant:
\b\d{4}[A-Z0-9]\b
The \b restricts the matches to word boundaries, so it won't report matches in the middle of a longer "word" (which may include digits), like "123456789ABCD".