I need a regular expression that checks if every - in the string has a letter before and after it.
I got this so far:
(([-])?[a-zA-Z ]+[a-zA-Z]+[-]+[a-zA-Z]+[a-zA-Z ]+$|[a-zA-Z ]+$)|([a-zA-Z ])
works for these examples:
- Tester
- tester_test
- Tes ter_te st
It doesn't work for these examples:
- Tester_test tester_test
- te st_te_st_te_st