I\'ve got a list of email addresses belonging to several domains. I\'d like a regex that will match addresses belonging to three specific domains (for this example: foo, bar
should be more generic, the a shouldn't count, although the @ should.
/@(foo|bar|baz)(?:\W|$)/
Here is a good reference on regex.
edit: change ending to allow end of pattern or word break. now assuming foo/bar/baz are full domain names.