Created
August 31, 2015 17:53
-
-
Save jakebathman/6573cd15f4213a282ab6 to your computer and use it in GitHub Desktop.
TryBot regex
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
<?php | |
$arrRegexPatterns = array( | |
'subreddit' => "/(reddit\.com|reddittryhard\.com)?(?:\/r\/){1}([\w]+)/i", | |
); | |
if (preg_match($arrRegexPatterns['subreddit'], $text, $arrMatches) !== false) | |
{ | |
echo json_encode($arrMatches); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment