Regular expression with as

i was doing this tutorial that show how to shake user input information; to see if they’re valid (like in standard html form) but if find it a little too long. So my question is if there is a way to use regular expression with actionscript ?
for example if you want to shake if a user’s email is valid