string1="block12emp"
string2="block12"
reg=re.match('^[\D]{2,6}[\d]{2}\D{3}$', string1) # returns, block12emp
The above regex works correctly
reg=re.match('^[\D]{2,6}[\d]{2}\D{3}$', string2) # returns, block12
Here, the excepted output for string2 is Null, but the regex returns block12
This regex will not match the full pattern, and returns only what matches in the string
How to match the string excatly with this pattern
Thanks