Skip to content

Instantly share code, notes, and snippets.

@ofca
Created April 29, 2014 21:45
Show Gist options
  • Save ofca/f8d07f096a4498f3ffb0 to your computer and use it in GitHub Desktop.
Save ofca/f8d07f096a4498f3ffb0 to your computer and use it in GitHub Desktop.
<?php
$strings = array(
'/bundle/foo/login',
'/bundle/foo/notLogin',
'/bundle/foo/loginNot',
'/bundle/foo/bar'
);
foreach ($strings as $string) {
echo $string, ' : ', (int) preg_match('/^\/bundle\/foo\/((?!login$).)*$/', $string), "<br />";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment