O'Reilly logo

Security with Go by John Daniel Leon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using regular expressions to find email addresses in a page

A regular expression, or regex, is actually a form of language in its own right. Essentially, it is a special string that expresses a text search pattern. You may be familiar with the asterisk (*) when using a shell. Commands such as ls *.txt use a simple regular expression. The asterisk in this case represents anything; so any string would match as long as it ended with .txt. Regular expressions have other symbols besides the asterisk, like the period (.), which matches any single character as opposed to the asterisk, which will match a string of any length. There are even more powerful expressions that can be crafted with the handful of symbols that are available.

Regular expressions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required