I have a form field:
web_address = forms.RegexField(regex=r'^DO SOMETHING$', error_messages = {'invalid': _("Not a valid web address.")})
I am unable to write a regular expression for the above address. My requirement is to validate the url in the form http://maps.google.com/maps/place?cid=1234. The id 1234 is a variant but the prior would be constant.
Please help!!!
There are just two thing to know
?and.are special characters in regex and need escaping\dor define your own[0-9]and say at least one\d+so your regex should look something like
If you want to learn more about regexes, http://www.regular-expressions.info is a good place to start.
To test you regexes you can use online testers like gskinner.com/RegExr/. You can see your regex here