Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

what does "?" in /content(/.*)? mean???

Avatar

Level 4

what does "?" in /content(/.*)?  mean???

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Community Advisor

This is regular expression. ? makes the pattern in () optional. To explain it further, if you use "?",  all paths under /content are valid(including /content as well) but if you dont use "?" then "/content" is not allowed.

/content [Invalid when "?" is NOT there]

/content/a [Valid in both]

/content/a/b [Valid in both]

Regex Tester and Debugger Online - Javascript, PCRE, PHP  is a good site to play around with different patterns..

Hope this helps

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Level 10

That's the defined regex which matches to the page path for template availability at a path.
regex - Difference Between '?' and '*' in regular expressions - Stack Overflow

Avatar

Korrekte Antwort von
Community Advisor

This is regular expression. ? makes the pattern in () optional. To explain it further, if you use "?",  all paths under /content are valid(including /content as well) but if you dont use "?" then "/content" is not allowed.

/content [Invalid when "?" is NOT there]

/content/a [Valid in both]

/content/a/b [Valid in both]

Regex Tester and Debugger Online - Javascript, PCRE, PHP  is a good site to play around with different patterns..

Hope this helps