Tagged template string regular expression compiler. v1.0.4, last updated 2016 (stable, low maintenance). Parses multiline RegExp strings embedded in template literals, stripping comments and whitespace for readability. Unlike normal RegExp, allows inline comments (# //), partials (interpolated regex or string), and ignores insignificant whitespace. Flags are set at compile time. No dependencies.
npm install regxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creation of a tag function with flags, multiline regex with comments, and interop with a RegExp partial.
Use a character class like [ ] or \s to include whitespace.
Pass /\d/ instead of '\d' to avoid escaping issues.
Consider alternatives like panda-regx or template-regexp for active maintenance.
Place // only at the end of a line after the regex content.
Use default import: import regx from 'regx'
Use require('regx').defaultUse template literal: const rx = regx('i'); const re = rx`/pattern/`;Use [ ] or \s to match literal whitespace characters.
No dependency data recorded yet.