Skip to content

Instantly share code, notes, and snippets.

@jrignacio
Last active January 15, 2023 14:39
Show Gist options
  • Save jrignacio/734426 to your computer and use it in GitHub Desktop.
Save jrignacio/734426 to your computer and use it in GitHub Desktop.
Regular expressions for common form fields in Singapore
contact = /(^[689]{1}\d{7}$)/;
mobile = /(^[89]{1}\d{7}$)/;
nric_fin = /^[FGST]{1}\d{7}[A-Z]{1}$/i;
email = /^([A-Z0-9_\.\-\+])+\@(([A-Z0-9\-])+\.)+([A-Z0-9]{2,4})+$/i;
postal_code = /(^\d{6}$)/;
unit_no = /([-#0-9])/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment