I want to match and group any of these listed words:
aboutus/,race/,cruise/,westerlies/,weather/,reach/,gear/ or empty_string
Here is a solution, but which will not match the empty_string:
^(aboutus|race|cruise|westerlies|weather|reach|gear)/$
So my question is: How to include Empty string in this matching?
I still don't get a good solution for this.
So I added one more regex specially for empty_string:ie ^$.
Note: these regular expression is for django urls.py.
update: It will be better if the capturing group does not contain /
Use this