compose-regexp/compose-regexp.js
View on GitHub ↗ ★ 150 JavaScript
Build and compose maintainable regular expressions in JavaScript.
10 mentions on Hacker News by 1 person: 1 story, 9 comments · first 2016-05-15 · latest 2023-03-28
20082026
-
For JS/TS, I’ll add https://github.com/compose-regexp/compose-regexp.js to that list.
comment by pygy_ · 2023-03-28 · in Show HN: Regex.ai – AI-powered regular expression generator -
With https://github.com/compose-regexp/compose-regexp.js you can have your cake and eat it too. It's a JS RegExp builder with a parser combinator API.
comment by pygy_ · 2023-03-06 · in Having trouble understanding your regexes? Try parser combinators -
…ported to JS: https://flems.io/#0=N4IgtglgJlA2CmIBcBWAzAOgAwCYA0IAzgMYBOA9... Here's the lib: https://github.com/compose-regexp/compose-regexp.js
comment by pygy_ · 2022-12-30 · in Pomsky – A portable, modern regular expression language -
…lib that adds support for RegExp composition, set opperations, atomic groups and arbitrary bounds. https://github.com/compose-regexp/compose-regexp.js
comment by pygy_ · 2022-06-10 · in Rulex – A new, portable, regular expression language -
▲ 6
Show HN: Compose-regexp.js Build readable and maintainable RegExps. ReDOS begonestory by pygy_ · 2022-05-04 · 1 comment
-
Mostly, yes. They can be applied with a different formalism though. See https://github.com/pygy/compose-regexp.js which uses a parser combinator API with regexps as backend.
comment by pygy_ · 2018-06-25 · in Parsing with Derivatives: A Functional Pearl (2011) [pdf] -
https://github.com/pygy/compose-regexp.js is another option (800 bytes mingzipped): const {sequence, suffix} = composeRegexp; const maybe = suffix("?"); const oneOrMore = suffix("+"); const urlMatcher = sequence( /^/, "http" maybe("s"),…
comment by pygy_ · 2018-03-16 · in Regular Expressions – Mastering Lookahead and Lookbehind -
…So this allows one to create regexps piece by piece, to write tests for the sub-expressions, etc... https://github.com/pygy/compose-regexp.js
comment by pygy_ · 2017-07-09 · in Show HN: Using functions to construct Regex in Python -
https://github.com/pygy/compose-regexp.js ^^^ Regexp combinators in JS. 614 bytes minimized and gzipped. Once you're proficient with the standard RegExp syntax, you can write pretty complex ones without external tools, but when the times…
comment by pygy_ · 2016-08-30 · in SRL – Simple Regex Language -
I made a JS lib just for that: https://github.com/pygy/compose-regexp.js Edit: real life example, a minimal lexer used to split compound CSS selectors on comas. We must skip those in strings, comments and in `:not(a, b)` pseudo-classes, so…
comment by pygy_ · 2016-05-15 · in Regular expressions you can read: a visual syntax and UI