Click here to Skip to main content
14,773,285 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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\*'))


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?
Posted

1 solution

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

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900