SyntaxFix
Write A Post
Hire A Developer
Questions
[a-z] matches a single char between a and z. So, if your string was just "d", for example, then it would have matched and been printed out.
[a-z]
"d"
You need to change your regex to [a-z]+ to match one or more chars.
[a-z]+