Free Regular Expression (Regex) Libraries and Source Code

Match Text Patterns the Concise and Efficient Way


Free Regular Expression (Regex) Pattern Matching Libraries and Source Code

Regular expression ("regex" for short) pattern matching is a concise and hopefully efficient way of specifying a piece of text for the purpose of searching for it or manipulating it in some way. It is often used in things like search and replace tools, text editors (for find and replace facilities), compiler construction, in a large number of programming languages (including, notably, Perl), etc.

The free libraries on this page allow you to include regex facilities in your programs without having to reimplement it from scratch. The libraries typically provide a set of functions or API that you can call to pass your regular expression and the string to use, and it will do the hard work for you. They are useful for people implementing text editors, command line shells, etc.

Incidentally, if you want to check your program's regular expressions handling (or even to just verify your own regex patterns) you can use one of the Free Interactive Regular Expression (Regex) Testers and Builders software around to compare the results.

Related Pages

Free Regular Expression (Regex) Libraries and Source Code

Hyperscan New

Hyperscan is a multiple regex matching library with a C API that supports PCRE regular expression syntax. It can simultaneously match large numbers (apparently up to tens of thousands) of regular expressions. It is open source, and was released by Intel under the 3-clause BSD licence.

GRETA Regular Expression Template Library New

GRETA is a Perl-compatible regular expression template library for C++ from Microsoft Research. The full Perl 5 regular expression syntax is supported. The library appears to have been tested for both Visual C++ and the gcc (the GNU compiler). Documentation for the library is included in the download itself (there is no information of any use on the download page I linked to above, at least, not that I can find). The licence included in the downloaded file says that you may only use the source code for non-commercial research or teaching purposes.

PCRE Library: Perl Compatible Regular Expressions

If you are familiar with the Perl regular expression syntax and semantics, the PCRE library will appeal to you. This library provides regex pattern matching in a Perl compatible way using both a native API as well as a set of wrapper functions that corresponds to the POSIX regular expression API. The library is distributed under the BSD licence.

Onigurama

Onigurama is a regular expressions library that allows you to specify a different character encoding for every regular expression object. It supports the GNU regex API, the POSIX regex API and the Onigurama native expressions. The library is licensed under the BSD licence and works under Unix-type systems (eg, Linux, Mac OS X, FreeBSD, etc) and Windows.

Boost C++ Libraries

The Boost C++ Libraries site is a source of "free peer-reviewed portable C++ source libraries" (quoted from the site). There are numerous libraries available, including libraries for regex matching (under "String and text processing"). With this library, it's possible to write your regular expression as a string or as an expression template, "which can refer to each other and themselves recursively with the power of context-free grammars".

Regular Expression Component Library

The Regular Expression Component Library uses a property-method-event architecture that works in Borland C++ Builder and Microsoft Visual C++ (see the Free C++ Compilers page for free official versions of the Microsoft and Borland compilers if you don't already have one).

regex

regex is a regular expression parser that is released into the public domain (or so the site says). It is useful if you want to write a program using regular expressions but don't want to use the GPL ones that come from the Free Software Foundation. (The package is somewhere in the middle of the page linked to; just scroll down to find it. At the time I write this, the link is called "basic regex".)

Related Pages

Newest Pages

Popular Pages

How to Link to This Page

It will appear on your page as:

Free Regular Expression (Regex) Libraries and Source Code

 


 

thesitewizard.com: Free Webmaster Tutorials, Scripts and Articles

HowtoHaven.com: Free How-To Guides

thefreecountry.com: Free Programmers, Webmasters and Security Resources
If you find this site useful, please link to us.