Doing the regex check properly