Can we add regex in query builder's path? | Community
Skip to main content
Level 2
October 16, 2015
Solved

Can we add regex in query builder's path?

  • October 16, 2015
  • 1 reply
  • 1664 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

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/.

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 26, 2023

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/.