Click here to Skip to main content
15,890,670 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:

SQL
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:

SQL
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!

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

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