Important

KDB-X General Availability (GA) Now Live

The KDB-X Public Preview period has ended. Please note that this Public Preview website is no longer updated. Visit the new KDB-X GA site for the latest documentation, downloads, and updates:

Go to the KDB-X GA site

Regex - PCRE2

This page introduces the PCRE2 module, explains how to use regular expressions in KDB-X, and outlines common text-processing use cases..

The PCRE2 module provides high-performance regular expression capabilities within KDB-X, enabling developers to efficiently search, match, and transform text using the industry-standard PCRE2 engine. By integrating PCRE2 directly into q workflows, this module supports advanced pattern matching, rich expression syntax, and flexible text-processing operations across structured and unstructured data. It is well-suited for tasks such as log analysis, data cleansing, validation, extraction, and other workflows requiring precise pattern evaluation.

The KDB-X PCRE2 module requires the PCRE2 library to be installed on your system. The library is generally pre-installed on macOS and most Linux distributions. If it is not available on your system, see the instructions below.

See the Regex PCRE2 documentation on GitHub for more information.