Skip to content

Instantly share code, notes, and snippets.

What would you like to do?


Online Regex Tester Suites & Code Generators

  1. regex101 Online regex tester for PHP, PCRE, JavaScript and Python that highlights pattern and matches on the fly. Also features a Code generator and a regex debugger! Online regex tester with gut regex replace and explain functionality. Can show neat expression diagrams (not active anymore). translates regular expressions into an SVG image (for documentation or embedding)

Regex Expression Generator UI & Code Generator & Explanator

txt2re: regular expression generator (with code generator for perl php python java javascript coldfusion c c++ ruby vb vbscript j# c#
Perl YAPE::Regex::Explain
Regex Generator++ Automatic Generation of Text Extraction Patterns from Examples
frak frak transforms collections of strings into regular expressions. Available as a command line utility (Clojure) and a JavaScript library.

Regex Pattern Libraries Regular Expression Library. Currently has 7601 expressions from 2492 contributors (most are subpar IMHO).

Langauge-specifc Regex Tester

Here I list language/flavor specific online regex testers. The order of the listings is intentional. The most useful tools (in my view) for the specific flavor are listed first, then alternative and secondary testers follow.

.NET Regex Tester

Java Regex





PHP Live Regex A Live Regular Expression Tester for PHP



Google Analytics Regex Tester (and a general GA RE usage guide)


Reverse Regex Random String Generators / Xeger

The principle is: Regex -> NFA, NFA -> minimal DFA, DFS-walk through the DFA (collecting all characters)


sre_yield: a Python library, generate all values that can match a given regular expression, or count possible matches efficiently
rstr Random Strings in Python is a helper module to generating random strings of various types fuzzy testing, generating dummy data, etc.
Python Xeger: Python library to generate random strings from regular expressions. sre_dump lets you dump the re tree back into a regular expression, useful for debugging.
inverse regex: given a regular expression string, produces random strings that match the expression.
EXREX: a command line tool and python module that generates all - or random - matching strings to a given regular expression and more.


Java Xeger: Java library for generating strings that match a specific regular expression.


Fare - Finite Auutomata and Regular Epressions is an effort to bring a DFA/NFA (finite-state automata) implementation from Java to .NET. There are quite a few implementations available in other languages today. This project aims to fill the gap in .NET. and provides a port of the well established Java library dk.brics.automaton.
REX Rex is a simple command-line tool that takes a .NET regex or several regexes and generates strings that match all the regexes (download).


regexp-examples Extends the Regexp class with the methods: examples (the generals *all strings that will match the given regular expression and random_example (one example).


regen a tool to generate random strings from Go/RE2 regular expressions


randexp.js Create random strings that match a given regular expression.


String::Random Perl module to generate random strings based on a pattern
YAPE::Regex Yet Another Parser/Extractor for Regular Expressions


regex-genex Given a list of regexes, generate all possible strings that matches all of them.


regxstring Random String Generator based on Regular Expression

Code beautifier & Syntax Highlither

Related Topics

htaccess tester
Mod Rewrite Generator can be used to turn dynamic URLs into search engine friendly static URLs (specific to transforming folders into parameters. Does not support more complex transformations, such as parameters to folders)

MS Office Wildcards

Finding and replacing characters using wildcards
OfficeToolTips: Using wildcards & Office Support


JavaScript Xeger more expressive regular expressions for JavaScript (i.e. sort of an alternative input language)



Character classes




ICU's Regular Expression loosely based on JDK 1.4 java.util.regex with some extensions. Used in R's stringi/stringr.
Regular Expressions as used in R





Regular expression syntax accepted by Google/RE2 (also lists some syntax accepted by PCRE, PERL, and VIM) as avialable in many Google products (Sheets, Docs, Analytics, etc.) text version

Lua Patterns


  • lrexlib, a multi-flavor regex library
  • LPeg, a powerful text parsing library for Lua based on Parsing Expression Grammar. It offers functions to create and combine patterns in Lua code, and also a language somewhat like Lua patterns or regular expressions to create small parsers.

Linux Text Processing Toolbelt






How a Regex Engine Works Internally Regular Expressions: Implementations and running times

Performance recommendations and best practices


Comparison of regular expression engines: Libraries, Languages, Features
Regular expression speed comparison
Performance comparison of regular expression engines

Perl Regex One-Liners

State Machine Compile, Lexer, Parser Generator

  • Ragel: compiles executable finite state machines from regular languages.


reggae: Automated Test Generation for Complex Regular Expressions
Rex: a tool that explores .NET regexes and generates members efficiently. Try Rex online
Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)
Overview of Learning Regular Languages: Get a regexp from a string
Aho–Corasick algorithm
Counting and Random Generation of Strings in Regular Languages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment