Socket
Book a DemoInstallSign in
Socket

@ericcornelissen/lregexp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ericcornelissen/lregexp

Transparently create linear-time regular expressions

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
207
Maintainers
1
Weekly downloads
 
Created
Source

lRegExp

Transparently create linear-time (non-backtracking) regular expressions.

Usage

This library exports a drop-in replacement for the built-in RegExp.

npm install @ericcornelissen/lregexp
import RegExp from "@ericcornelissen/lregexp";
new RegExp("[linear]{6}");

Why

Backtracking regular expressions can take exponential time to evaluate, leading to the dreaded ReDoS vulnerability. Linear-time regular expressions avoid this by not backtracking.

Caveats

Not all regular expression constructs are valid in a linear-time regular expression and this library won't tell you your regular expression is incompatible unless you run it with the non-backtracking engine, in which case it throws an error.

Keywords

regexp

FAQs

Package last updated on 21 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.