Regular expression for one lowercase word

I am looking for a regular expression pattern that ensures that the user puts in one lowercase word with only the letters of the alphabet. Mostly they choose a subdomain. thanks in advance

+5
source share
3 answers

A character class [a-z]describes one character alphabet lowercase letters a- z. If you want the input to contain only the characters of this class, use this:

^[a-z]+$

^and $mark the beginning and end of the line, respectively. And the quantifier +allows one or more repetitions of the previous expression.

+7
source

^ [a-z] + $ , .

+2

/ ^ [AZ] + $ /

make sure you don't use 'i' after the last slash

/ [AZ] + /

if you are looking for any words in context

0
source

All Articles