This is a comparison of regular expression engines.
Libraries
+ List of regular expression libraries Name Official website Programming language Software license Used by Boost.Regex Boost C++ Libraries C++ Notepad++ >= 6.0.0, EmEditor BoostXpressive Boost C++ Libraries C++ DEELX RegExLab C++ FREJ Fuzzy Regular Expressions for Java Java GLib/GRegex GLib reference manual C GNU regex Gnulib reference manual C GNU libc, GNU programs GRETA Microsoft Research C++ GregexGrovf Inc. RTL, HLS FPGA accelerated >100 Gbit/s regex engine for cybersecurity, financial, e-commerce industries. HyperscanIntel C, x86-specific assembly (SSSE3+) Rspamd ICU International Components for Unicode C, C++ Foundation (Apple and Swift open-source versions) Irregexp Irregexp C++ Chrome, Firefox, Node.js Jakarta Regexp The Apache Jakarta Project Java java.util.regex Java's User manual Java jEdit JRegex JRegex Java MATLAB Regular ExpressionsMATLAB Language OnigurumaKosako C Atom, Take Command Console, Tera Term, TextMate, Sublime Text, SubEthaEdit, EmEditor, jq, Ruby Java port of Oniguruma joni Java JRuby, Nashorn (JavaScript engine) Pattwo Stevesoft Java (compatible with Java 1.0) PCRE pcre.org C, C++ Apache HTTP Server, Nginx, BBEdit, Edbrowse, Julia, HHVM, Notepad++ < 6.0.0, PHP, Delphi, R, Exim, SWI-Prolog, Elixir, Erlang Qt/QRegExp Digia C++ Kate, Kile regex - Henry Spencer's regular expression libraries ArgList C RE2 RE2 C++ Go, Google Sheets, Gmail, G SuiteRegex+slevithan/regex on GitHub JavaScript Henry Spencer's Advanced Regular Expressions Tcl C RGX RGX C++ based component library RXP Titan IC RTL hardware-accelerated search acceleration using RegEx available for ASIC, FPGA and cloud. Enables massively parallel content processing at ultra-high speeds. SubReg Matt Bucknall C TPerlRegEx TPerlRegEx VCL Component Object Pascal TRE Ville Laurikari C musl TRegex TRegex Java GraalVM TRegExpr TRegExpr, documentation, (RegExp Studio) Object Pascal Total Commander Wolfram Language (Mathematica) Wolfram Language Documentation Center Wolfram Language Mathematica, the Wolfram Development Platform XRegExp XRegExp JavaScript YARR YARR C++ Safari, WebKit-based browsers, QML
Languages + List of languages and frameworks including regular expression support Language Official website Software license Remarks ActionScript 3 ActionScript Technology Center APL (APLX, Dyalog, GNU) APL Wiki ⎕SS (PCRE), ⎕R/⎕S (PCRE), ⎕SS (PCRE2), respectively C++11 (C++) C++ standards website Since ISO14822:2011(e), similar to ECMAScript on default (Grammar Description) D D Elixir elixir-lang.orgApache 2.0 Standard library includes PCRE-based Regex module. The matching algorithms of the library are based on the PCRE library, but not all of the PCRE library is interfaced and some parts of the library go beyond what PCRE offers. Currently PCRE version 8.40 (release date 2017-01-11) is used. Erlang erlang.orgApache 2.0 Standard library includes PCRE-based re module. The matching algorithms of the library are based on the PCRE library, but not all of the PCRE library is interfaced and some parts of the library go beyond what PCRE offers. Currently PCRE version 8.40 (release date 2017-01-11) is used. Free Pascal (Object Pascal) freepascal.org Free Pascal 2.6+ ships with TRegExpr from Sorokin and two other regular expression libraries; See wiki.lazarus.freepascal.org/Regexpr. Go go.dev Haskell Haskell.org Omitted in the language report, and in GHC's Hierarchical Libraries Java Java REs are written as strings in source code: all backslashes must be doubled, harming readability. JavaScript (ECMAScript) ECMA-262 First-class citizens of the language with a special /.../mod syntax. Historically feature-limited, but improved since ES2018. Two major regex engines: V8's Irregexp (used in Chrome and Blink-based browsers, as well as Firefox, Node.js) and JavaScriptCore's YARR (in Safari and WebKit-based browsers). Julia JuliaLang.org REs are part of the language core library using PCRE built-in and an optional wrapper for (C code) ICU is available. Lua Lua.org Uses simplified, limited dialect; can be bound to more powerful library, like PCRE or an alternative parser like LPeg. Mathematica Wolfram .NET MSDN Nim nim-lang.org Standard library includes PCRE-based re and nre modules, as well as various alternatives (ex. strutils, pegs (Parsing Expression Grammar matching), strscans, parseutils, etc.). OCaml Caml , the standard module is generally regarded as deprecated; often recommended libraries are pcre (with full support for PCRE) and re (which is not as complete but claims better performance and provides frontends to popular syntaxes: PCRE, Perl, Posix, Emacs, shell globbing). Perl Perl.com Full, central part of the language PHP PHP.net Has two implementations, with PCRE being the more efficient in speed, functions POSIX C (C) POSIX.1 web publication Supports POSIX BRE and ERE syntax Python python.org Python has two major implementations, the built in re and the regex library. Ruby ruby-lang.org Ruby 1.8, Ruby 1.9, and Ruby 2.0 and later versions use different engines; Ruby 1.9 integrates Oniguruma, Ruby 2.0 and later integrate Onigmo, a fork from Oniguruma. Rust docs.rs The primary regex crate does not allow look-around expressions. There is an Oniguruma binding called onig that does. SAP ABAP SAP.com Tcl tcl.tk Tcl library doubles as a regular expression library. Wolfram Language Wolfram Research XML Schema W3C XPath 3/XQuery W3C
Language features NOTE: An application using a library for regular expression support does not necessarily support the full set of features of the library, e.g., GNU grep uses PCRE, but supports no lookahead, though PCRE does.
Part 1 + Language feature comparison (part 1) "+" quantifier Negated character classes Non-greedy quantifiers Shy groups Recursion Look-ahead Look-behind Backreferences >9 indexable captures Boost.Regex Boost.Xpressive CL-PPCRE EmEditor FREJ GLib/GRegex GNU grep Haskell RXP ICU Regex Java JavaScript (ECMAScript) JGsoft Lua .NET OCaml PCRE Perl PHP Python Qt/QRegExp RE2 Regex+ Ruby, Onigmo TRE Vim RGX Tcl TRegExpr XML Schema XPath 3/XQuery XRegExp
Part 2 + Language feature comparison (part 2) Directives Conditionals Atomic groups Named capture Comments Embedded code Unicode property support Balancing groups Variable-length look-behinds Boost.Regex Boost.Xpressive CL-PPCRE EmEditor FREJ GLib/GRegex GNU grep Haskell RXP ICU Regex Java JavaScript (ECMAScript) The support and range of properties is dependent on implementation. JGsoft Lua .NET OCaml PCRE Perl PHP Python Qt/QRegExp RE2 ? Regex+ Ruby, Onigmo Tcl TRE Vim RGX XML Schema XPath 3/XQuery XRegExp Leading only
API features + API feature comparison Native UTF-16 support Native UTF-8 support Multi-line matching Partial match Boost.Regex GLib/GRegex RXP ICU Regex Java .NET PCRE Qt/QRegExp Qt/QRegularExpression Tcl TRE RGX wxWidgets::wxRegEx XRegExp
See also
Comparison of parser generators
References
External links Regular Expression Flavor Comparison – Detailed comparison of the most popular regular expression flavors Regexp Syntax Summary Online Regular Expression Testing – with support for Java, JavaScript, .Net, PHP, Python and Ruby Implementing Regular Expressions – series of articles by Russ Cox, author of RE2 Regular Expression Engines