Created
August 29, 2009 18:49
-
-
Save joestump/177617 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
<?php | |
$strings = array( | |
'adsfa sdf adf asdf asdf adfasdfa sdf asdf', | |
'i like to buy ^abc, ^aa, ^aaaa, ^d.', | |
'^^Here is my twitter comment.', | |
'Here is my tweet. ^^I like turtles.' | |
); | |
foreach ($strings as $str) { | |
echo $str . "\n"; | |
var_dump(preg_match('/\^\^/', $str)); | |
$m = array(); | |
var_dump(preg_match_all('/\^(?P<cities>[a-z]{2,})/i', $str, $m)); | |
print_r($m); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment