-
Type:
New Feature
-
Status: Open
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: AQL
-
Labels:
I have need to query the path of an artifact using AQL but to match any number (0 or more) of characters except a certain character. In short, I am looking to use the following regex:
[^\/]* as part of my query. My use case is the following:
I want to store artifacts in the following way inside the repo
dir1/dir2/dir3/{rest of directory structure}
I want to search items based on their path. I want to use wildcards when matching on the three top-level directories names. So if my items are stored under:
foo/bar/123/
I want to be able to search for:
oo/ar/23
fo/ba/12
foo/bar/123
and get this as a result but I want to also be able to not give it any values and get it as a result like searching for //*.
At the same time I may have the following directory structures in the repo:
dir1/dir2/dir3/foo/bar/123
foo/dir2/dir3/bar/123
In these cases I don't want these to show up in my results when I'm searching for foo/bar/123. In other words, I only care about the three top-level folders in the repo but for those three I want to search based on wildcards even if I don't know their exact names.
I've come up with the following regular expression to match path on:
[^\/]{dir1-searchvalue}[^\/]/[^\/]{dir2-searchvalue}[^\/]/[^\/]{dir3-searchvalue}[^\/]
With this bit [^\/]* I am trying to match 0 or more of any character except / since / is a delimiter between the directories in the item path.