Created
December 11, 2011 18:19
-
-
Save lemon-tree/1461911 to your computer and use it in GitHub Desktop.
Matching
This file contains hidden or 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 | |
$string = '/index/hi | |
/user/dfhds | |
/register/ddd | |
/etc/blah | |
/etc/'; | |
preg_match_all("/^\/(?!(user|index|register))\w+\/\w*$/m", $string, $matches); | |
print_r($matches); | |
//Array | |
//( | |
// [0] => Array | |
// ( | |
// [0] => /etc/blah | |
// [1] => /etc/ | |
// ) | |
// | |
// [1] => Array | |
// ( | |
// [0] => | |
// ) | |
// | |
//) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment