Code:
$regex($5,/^\50~?[a-z]\d{3,4}(?:@.*)?\51$/)


\50 is octal for (.

\51 is octal for ).


New username: hixxy