Menu

MicroRegExp : tiny (50kb) regexp engine (with 3 API)

#esp32#redditesp32#regexp#pcre#engine
Reading 0:00
15s threshold

Hello,

This post is about a C library, it is not a board review. But I was not able to post without adding of one of 3 "flairs" (AI Generated/Board Review/I made a thing).

As a part of a larger project I made a regexp engine for microcontrollers. It was tested on ESP32 / FreeRTOS, and also in Windows/CYGWIN. Didn't test it in Linux but it should work.

It is built on top of modified SLRE (Simple Lightweight Regular Expressions);

It is just 2 files ( regexp.c and regexp.h ) which can be include 'd directly to your source file. Or it may be compiled as a separate unit.

It has 3 different API :

The original one, slre_match() ; no memory allocations, fastest

PCRE-like functions and structures starts with pl_... (PCRE-Lite); for those familiar with PCRE

PHP preg API: an implementation of PHP regular expressions; for PHP fans; functions and structures start with preg_...

There are some limitations: UTF8 is processed as stream of bytes, so [а-я] will not be understood. No lookarounds.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.