AEM - How to restrict a template from showing in a certain path

萝らか妹 提交于 2019-12-06 06:04:37

You can always restrict a more generic pattern with a lookahead. Here is an expression that should work for you:

^(?!/content/www/[^/]*/[^/]*/test-templates(?:/|$))/content/www/[^/]*/[^/]*(/.*)

See demo.

  • ^ - matches the start of string
  • (?!/content/www/[^/]*/[^/]*/test-templates(?:/|$)) - makes sure the next substring is not /content/www/<some_node>/<some_node>/test-templates, followed by the end of string ($) or /
  • /content/www/[^/]*/[^/]*(/.*) - matches /content/www/<some_node>/<some_node> followed with optional / and zero or more characters other than a newline
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!