コード例 #1
0
 protected function toRegex($str)
 {
     if (preg_match('/^([^a-zA-Z0-9\\\\]).+?\\1[ims]?$/', $str)) {
         return $str;
     }
     return Glob::toRegex($str);
 }
コード例 #2
0
ファイル: GlobTest.php プロジェクト: robo47/symfony
 /**
  * @dataProvider getToRegexData
  */
 public function testToRegex($glob, $match, $noMatch)
 {
     foreach ($match as $m) {
         $this->assertRegExp(Glob::toRegex($glob), $m, '::toRegex() converts a glob to a regexp');
     }
     foreach ($noMatch as $m) {
         $this->assertNotRegExp(Glob::toRegex($glob), $m, '::toRegex() converts a glob to a regexp');
     }
 }