(C++) Boost.Regex

January 17, 2018 ยท View on GitHub

Boost.Regex is a Boost library for regular expressions.

Example programs and code snippets

Example boost::regexes

+--------------------------------------+--------------------------------------+ | Regex | Purpose | +--------------------------------------+--------------------------------------+ | .*\.(h|hpp|c|cpp)\z | Test filename for .c, .cpp, .h or | | | .hpp extension | +--------------------------------------+--------------------------------------+ | \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} | IP address | +--------------------------------------+--------------------------------------+ | http://(www\.)?(\w*\.)+\w* | General internet domain | +--------------------------------------+--------------------------------------+ | here | Internet domain that checks for | | | valid extensions | +--------------------------------------+--------------------------------------+ | (\(\d,\(\d,\d\)\))|(\(\(\d,\d\),\d\ | Simple [Newick](CppNewick.md) | | )) | | +--------------------------------------+--------------------------------------+

Qt Creator Note for Qt Creator users

Add the following line to your project file (to prevent link errors):

LIBS += -lboost_regex