Parse Strings with Regular Expressions
Learn to parse strings with regular expressions.
We'll cover the following
Regular Expressions (commonly abbreviated as regex) are commonly used for grep
, awk
, and sed
, and are an integral part of the Perl language. There are a few common variations in the syntax. A POSIX standard was approved in 1992, while other common variations include Perl and ECMAScript (JavaScript) dialects. The C++ regex
library defaults to the
The regex
library was first introduced to the STL with C++11. It can be very useful for finding patterns in text files.
How to do it
For this recipe, we will extract hyperlinks from an HTML file. A hyperlink is coded in HTML like this:
Get hands-on with 1400+ tech skills courses.