Skip to content

Instantly share code, notes, and snippets.

@aquapi
Last active August 5, 2025 12:35
Show Gist options
  • Save aquapi/e6f25d3840866dd9dbfbce7b51805202 to your computer and use it in GitHub Desktop.
Save aquapi/e6f25d3840866dd9dbfbce7b51805202 to your computer and use it in GitHub Desktop.
// Check whether email is somewhat valid (HTML5 input type=email)
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+?@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
// Valid JS identifier
/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment