{"library":"regx","title":"regx","description":"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.","language":"javascript","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["npm install regx"],"cli":null},"imports":["import regx from 'regx'","const regx = require('regx').default","import regx from 'regx'; const rx = regx('gi'); const re = rx`/pattern/flags`;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import regx from 'regx';\n\nconst rx = regx('i');\nconst pattern = rx`\n  ^        // start of line\n  [a-z]+   // one or more letters\n  $        // end of line\n`;\n\nconsole.log(pattern); // /^[a-z]+$/i\nconsole.log(pattern.test('hello')); // true\nconsole.log(pattern.test('123')); // false\n\n// Using a partial\nconst digit = /\\d/;\nconst mixed = rx`\n  ${digit}+  // digits only\n`;\nconsole.log(mixed); // /\\d+/i\n","lang":"javascript","description":"Shows creation of a tag function with flags, multiline regex with comments, and interop with a RegExp partial.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}