I need to write a regex that checks if:
- string starts and end with letter
- contains only letters, numbers, _ and ,
- _ can be present only between 2 letters, 2 numbers or a letter and a number
- , can be present only between 2 letters
What i have until now is this: ^[a-zA-Z][(a-zA-Z0-9_)(,a-zA-Z0-9_)]*[a-zA-Z]$, but I don't know how to add the last 2 requirements to it.
Can someone help?