Using regular expressions is probably the best way. You can see a bunch of tests here (taken from chromium)
Username
Password
Remember Me
Email
Username or Email