Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compose-regexp

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compose-regexp - npm Package Versions

1235

0.6.3

Diff

Changelog

Source

v0.6.3

2022-04-24

Bug fixes

  • Better logic to upgrade non-u regexp to unicode
pygy
published 0.6.2 •

Changelog

Source

v0.6.2

2022-04-22

New features

  • noBound(x) matches where bound(x) doesn't and vice-versa. Think /\B/ vs /\b/.
  • charSet.invert(x) will succeed where x doesn't and vice-versa. think /[^a-z]/ vs /[a-z]/

Bug fixes

  • Fix a typo in the mixed m-flag detection code for legacy environments
  • added Compatibility and Contribution sections in the README
pygy
published 0.6.1 •

Changelog

Source

v0.6.1

2022-04-22

Doc tweaks for the npm README

pygy
published 0.6.0 •

Changelog

Source

v0.6.0 (things are getting serious)

2022-04-22

This version revamps the core to provide better support for the u flag. The ref() story is also far more robust. ref() lets us introduce an atomic() helper that prevents the engine from backtracking.

Breakin changes

  • avoid() becomes notAhead() (mirroring the newly introduced lookBehind(), notBehind() scheme).
  • back references (e.g. \1) are now updated when regexps that hold them are combined. sequence(/(.)\1/, /(.)\1/) returns /(.)\1(.)\2/
  • ref() now returns a thunk, to let one create back references programmatically. sequence(/(.)/, ref(1)) returns /(.)\1/
  • The u flag is now contagious, non-unicode RegExps are promoted to unicode when possible.
  • RegExp with an m or s flag are converted into flagless equivalent that match the same input (e.g. /./s => /[^]/)
  • We're now stricter WRT input. Pass in a bad argument, and you'll ~~meet the wrath of our ...~~ get a nice error message.
  • Beside u promotion and m and s folding, the combinators don't accept mixed flags as input.

New features

  • atomic(...exprs) will create an atomic group that prevents backtracking into the expression once it has matched. ReDOS, begone! atomic() is direction sensitive, see below).
  • bound(pattern) generalizes the /\b\ assertion to arbitrary character classes (or patterns, really)
  • charSet.*() methods let one do set arithmetics on character sets.
  • The combinators also accept as parameters, string, regexps, or arrays of parameters and functions that return parameters. An Arrays is treated like sequence(). Functions come in handy for look behind assertions.
  • ref("label") creates a named reference (/\k<label>/).
  • namedCapture("label", ...) returns (/(?<label>...)/)
  • support lookBehind() and notBehind() assertions.
  • pattern directionality. Patterns that contain numeric back-references have an assorted direction depending on the context where they are evaluated, and they can't be mixed. The default is forward, so lookBehind(ref(1), capture(/\w/)) will be rejected. lookBehind(()=>[ref(1), capture(/\w/)]) however will do what you want, because the function is then evaluated in backward context.

Bug fixes

  • fix the exports paths in package.json

Shout out

... to @Hypercubed who submitted a PR for an issue that was solved independently.

pygy
published 0.5.3 •

Changelog

Source

v0.5.3

  • fix broken package.json
pygy
published 0.5.2 •

Changelog

Source

v0.5.2

  • added an auto-curried version of flags().
  • ported the full test suite to ospec

before

Here be drgns...

pygy
published 0.4.2 •

pygy
published 0.4.1 •

pygy
published 0.4.0 •

pygy
published 0.3.0 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc