what does "?" in /content(/.*)? mean??? | Community
Skip to main content
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 viveksachdeva

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

2 replies

edubey
Level 10
July 24, 2017

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

viveksachdeva
Community Advisor
viveksachdevaCommunity AdvisorAccepted solution
Community Advisor
July 24, 2017

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