Match to string length by using regex in python
Writing python regex for string. I want the string to be at least 1 symbol
and max 30. The problem is that im using 3 sub-blocks in regex letters, so
there always must be 3 characters long length. Is it possible to add that
condition in this regex (1-30 characters length):
regex = re.compile("^[a-zA-Z]+[a-zA-Z0-9\.\-]+[a-zA-Z0-9]$")
r = regex.search(login)
Thank you.
No comments:
Post a Comment