I'm trying to write an email validation program, and I'm having a lot of trouble finding a way to check a string for invalid consecutive chars. Specifically, emails cannot have a repeated ".", "-", or combination of these two chars, so [email protected] is invalid.

Does anyone have any ideas on how I could approach this? In particular, the "-." and ".-" possibilities are messing me up.

Any help would be appreciated!

Thanks,
--valhalla8