Adobe CQ5对话框编辑器,正则表达式属性:
我受到了正则表达式的挑战,所以请原谅我,但是这似乎是一项简单的任务,而且我似乎无法在互联网上的其他地方找到合适的解决方案。每个看起来正确的建议似乎在adobe的regex领域都不起作用。
我希望内容管理员为“谢谢”页面提供一个相对URL。我不需要任何花哨的东西,只要在管理员提供的文本内的任何地方找到“ http”或“ .com”,我只是想拒绝管理员的输入。
Examples for admin supplied input:
URL REGEX VALIDATES INPUT AS SUCCESS?
http://www.domain.com/questions No. string has both "http" and ".com"
https://www.domain.com/mail No. string has both "http" and ".com"
https://www.domain.net No. string has "http"
oopshttp://www.domain.net No. string has "http"
www.domain.com/mail No. string has ".com"
/subdomain/thankyou.html YES! string has neither "http" or ".com"
理想情况下,拒绝“ http”和“ .com”将补充我目前拥有的内容:字符串必须以正斜杠“ /”开头并以“ .html”结尾,即:
/^\/.+?\.html$/
任何帮助表示赞赏,在此先感谢您
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句