Fixing regex check