Can someone help me in writing regular expression to match such kind of string
Rules are:
- It should start with nl
- It can or cannot have one parameter in between nl and contact (like /abc/) but not ( /abc/def/)
- It can have anything after contact
Examples:
nl/abc/contact --> allowed
nl/contact --> allowed
nl/abc/def/contact --> not allowed
nl/abc/contact/mno --> allowed
nl/abc/contactmno/ ---> not allowed
I tried writing one ("^nl(.?)/contact(.)$"), but it has a problem that it allows any number of slashes between nl and contact wheras I just want at max one slash in between