Expand my Community achievements bar.

Setting regular expression to validate URL format in Adobe CQ5 | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

Setting regular expression to validate URL format in Adobe CQ5 by howtoaem Blog

Abstract

I want to validate a URL inside a textfield using Adobe CQ5, so I set up the properties regex and regexText as usual, but for some reason is not working:


So when I type inside the component I can see an error message at the console:

Uncaught TypeError: this.regex.test is not a function
To be more accurate the error comes from this line:

if (this.regex && !this.regex.test(value)) {
I tried several regular expressions and none of them worked. I guess the problem is the regular expression itself, because in the other hand I have this other regex to evaluate email address, and it works perfectly fine:

/^[A-za-z0-9]+[\\._]*[A-za-z0-9]*@[A-za-z.-]+[\\.]+[A-Za-z]{2,4}$/
Any suggestions? Thanks in advance

Read Full Blog

Setting regular expression to validate URL format in Adobe CQ5

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies