(mySql)查询是否匹配/exact\u string/[wildcard]/exact\u string/[wildcard]等?
我的URL看起来像 “/api/comments/languages/124/component/segment_translation/2” 我知道url的哪些部分是静态的;它们是动态的,有一个结构告诉我这一点 我有一些示例请求和响应(动态部分不匹配)——我正试图在mySQL中查找它们——因此我可以非常轻松地生成一个查询(mySql)查询是否匹配/exact\u string/[wildcard]/exact\u string/[wildcard]等?,mysql,regex,match,Mysql,Regex,Match,我的URL看起来像 “/api/comments/languages/124/component/segment_translation/2” 我知道url的哪些部分是静态的;它们是动态的,有一个结构告诉我这一点 我有一些示例请求和响应(动态部分不匹配)——我正试图在mySQL中查找它们——因此我可以非常轻松地生成一个查询 select url from qb_log_full_requests where URL REGEXP 'api/comments/languages/[^f.*]/
select url from qb_log_full_requests
where
URL REGEXP 'api/comments/languages/[^f.*]/component/[^f.*]/[^f.*]'
这是伟大的;但它不起作用
有没有办法让mySQL匹配
/精确字符串/[通配符]/精确字符串/[通配符]
etc?您可以尝试以下regexp:
/api/comments/languages/[^/]+/component/segment_translation/[^/]+当您将
*
放在字符类([…]
)内时,表示您正在查找这些字符。