Regular Expressions 101

Community Patterns

Nato Stock Number (Add dashes)

2

Regular Expression
PCRE (PHP <7.3)

/
(\d{4})(\d{2})(\d{3})(\d{4})
/

Description

Takes a 13 digit non-dashed Nato Stock Number and uses the Substitution to add the dashes in

Submitted by Matthew Perryman - 8 years ago