Regular Expressions 101

PaySafeCard (PSC) Code

Open Workspace
  • PCRE (Legacy)
  • Match
2

Regular Expression

/
(0[0-9]{3}(\-|)[0-9]{4}(\-|)[0-9]{4}(\-|)[0-9]{4})
/

Description

Matches codes with and without minus (-) Prevents fake codes like "1234-1234-1234-1234"

Submitted by timmyrs