使用Match编制索引服务正则表达式 [英] Crafting a Indexing Service Regex using Match

查看:137
本文介绍了使用Match编制索引服务正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试创建索引查询来处理路径,例如:

d:\< REMOVED> \ assets \ 0 \ 4294967308 \ 200 \ 8589934710 \ 8589934711 \ 8589934712 \ 8589934715 \ 8589934951_2057.xml

本质上,我需要在文件名前匹配数字(但不要在前面!).如果文件夹在某处的路径中,我可以匹配:

Hi,

I''m trying to create an indexing query to process a path, such as:

d:\<REMOVED>\assets\0\4294967308\200\8589934710\8589934711\8589934712\8589934715\8589934951_2057.xml

Essentially, I need to match the number before the file name (but not before!). I can match if the folder is in the path somewhere with:

SELECT Path
FROM <CATALOG>..SCOPE()
WHERE (MATCHES(PATH, '*\8589934715\*'))



但是,当我尝试仅匹配最后一个文件夹时,查询始终返回0个匹配项.我已经尝试了多种变化:



However, when I try to to only match the last folder the query always returns 0 matches. I''ve tried dozens of variations around:

SELECT Path
FROM <CATALOG>..SCOPE()
WHERE (MATCHES(PATH, '*\8589934715\|[^\]+'))





Does any one have any pointers?

推荐答案

自己解决了它....通过使用两个正则表达式!

Solved it myself....through using two regexs!

SELECT Path
FROM <CATALOG>..SCOPE()
WHERE  (MATCHES(PATH, '*\8589934712\*'))
 AND NOT (MATCHES(PATH, '*\8589934712\*\*'))


这篇关于使用Match编制索引服务正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆