Expand my Community achievements bar.

SOLVED

Can we add regex in query builder's path?

Avatar

Level 2

HI,

I have a query where in need to add regex in the query builder's path property Like: path: /a/b/c/*/d, where my node structure at * is changing.

Is there a way to do this?

 

Also, is there a way where i can add groups inside group and put and/or conditions?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Regular expressions are not natively supported in AEM Query Builder. However, you can still achieve some basic pattern matching using wildcards.

{
  "path": "/content/mysite/en/",
  "type": "cq:Page",
  "property": "jcr:title",
  "property.value": "page*",
  "property.operation": "like"
}

In this example, we use "property.value": "page*" with the "like" operation. The * wildcard allows for any characters to come after "page." This will match nodes with titles like "page1," "page2," etc., under the path /content/mysite/en/.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Regular expressions are not natively supported in AEM Query Builder. However, you can still achieve some basic pattern matching using wildcards.

{
  "path": "/content/mysite/en/",
  "type": "cq:Page",
  "property": "jcr:title",
  "property.value": "page*",
  "property.operation": "like"
}

In this example, we use "property.value": "page*" with the "like" operation. The * wildcard allows for any characters to come after "page." This will match nodes with titles like "page1," "page2," etc., under the path /content/mysite/en/.