Skip to content

Functional Expression Background

Functional Expression Background

functional-expression is a library to build regular expressions in a functional way, making readability and maintenance of regular expressions easier.


This library was born out of necessity while I was working in an upgrade for, in which I needed a powerful regular expression, but tracking issues on it became really hard really fast, so I started working on this library on the side just to build that expression, and I ended up making this public as well.


I built this library using TypeScript, with configurations from my shared configs. I made it ESM only as soon as Node started supporting ESM modules, and I made it tree-shakeable by using named exports.

I went to the trusty RegExr to get documentation about all the expression syntax I had available, and I used their descriptions to document my utils.


Currently I use this in but most probably I’ll end up using it every time I need to write some regular expressions from now on.