Last active
January 16, 2020 14:30
-
-
Save mbparvezme/430662efae1618de3ad59dd6d387ee82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$testUsername = "https://twitter.com/webdevronsocial"; | |
$regEx = '/(?:https?:\/\/)?(?:www\.)?twitter\.com\/(?:#!\/)?@?([a-zA-Z0-9_]{1,15})/'; | |
if( preg_match( $regEx, $testUsername, $matches ) ){ | |
/** | |
This is valid, play your code here | |
- $matches[0] will returns the profile URl | |
- $matches[1] will returns the Username | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment