Skip to content

Instantly share code, notes, and snippets.

@mbparvezme
Last active January 16, 2020 14:24
Show Gist options
  • Save mbparvezme/8e6d290913fd24a58890a140e7d7195c to your computer and use it in GitHub Desktop.
Save mbparvezme/8e6d290913fd24a58890a140e7d7195c to your computer and use it in GitHub Desktop.
$testUsername = "webdevronsocial";
$regEx = '/^@?([a-zA-Z0-9_]{1,15})$/';
if( preg_match( $regEx, $testUsername ) ){
/* This is valid, play your code here */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment