regex

2026.2.28 · active · verified Sat Mar 28

An alternative regular expression module designed to replace Python's built-in 're' module, offering additional functionality. Current version: 2026.2.28. Release cadence: Regular updates.

Warnings

Install

Imports

Quickstart

Basic usage of the regex module to find all words in a text.

import regex

pattern = r'\b\w+\b'
text = 'Hello, world!'
matches = regex.findall(pattern, text)
print(matches)

view raw JSON →