This will cause 1 or more characters, which are either lowercase az or hyphen
[a-z\-]+
The trick is to avoid a backslash hyphen.
For completeness, you can add an appropriate border, such as \ b at each end, to indicate complete coincidence of words, or ^ and $ so that it matches the complete line.
source
share