I am working on application which needs user to add multiple GroupName in textbox.
1. The GroupName can be separated by “,” / “or” / “OR”.
2. Input should not start with or end with “,” / “or” / “OR”.
eg: GroupName, GroupName or GroupName OR GroupName or GroupName, GroupName, GroupName, GroupName or GroupName
For this i have written a Regular expression but iam not able to implement the 2nd point.
The regex developed so far is
/^([a-zA-Z])(\s|[,\s]|[or\s]|[OR\s]?[a-zA-Z])*$/
It would be good help if someone from community would participate to help me out.
Thanks.
if you want to validate the input:
*(explanation here)