I would like to have a regex that matches the following domains:
- dev.api.company.com
- live.api.company.com
- test1.dev-api.company.com
- test2.live-api.company.com
- yyy.XXXapi.company.com
But does not match on the followings:
- dev-api.company.com
- live-api.company.com
- api.company.com
- XXXapi.company.com
I have tried this: ^[a-z]+.[a-z-]*api.company.com$ but it not working, and I can not make it work. Can you help me please?
I am using javascript String.match() function.