sor*_*ist 3 php regex codeigniter
我正在为我的CodeIgniter应用程序开发一些路由,我需要声明一个'catch-all'/除了一个正则表达式.任何不以'ajax /'开头的路由都应该重定向到'main'-router.像这样:
$route['regexmagichere'] = "main";
Run Code Online (Sandbox Code Playgroud)
所以这绝对超出了我的正则表达式技能,我需要一些帮助.正则表达式应该在所有不以'ajax /'开头的字符串上返回true ,如下所示:
$string_one = "ajax/someotherstuffhere";
$string_two = " ajax/test";
$string_three = "somestuffhere";
Run Code Online (Sandbox Code Playgroud)
这里$ string_one将是唯一一个返回false的人.谢谢你的时间!