1. regjsparser
Parsing the JavaScript's RegExp in JavaScript.
regjsparser
Package: regjsparser
Created by: jviereck
Last modified: Mon, 13 Mar 2023 17:35:51 GMT
Version: 0.10.0
License: BSD-2-Clause
Downloads: 103,506,164
Repository: https://github.com/jviereck/regjsparser

Install

npm install regjsparser
yarn add regjsparser

RegJSParser

Parsing the JavaScript's RegExp in JavaScript.

Installation

 npm install regjsparser

Usage

 var parse = require('regjsparser').parse;

var parseTree = parse('^a'); // /^a/
console.log(parseTree);

// Toggle on/off additional features:
var parseTree = parse('^a', '', {
  // SEE: https://github.com/jviereck/regjsparser/pull/78
  unicodePropertyEscape: true,

  // SEE: https://github.com/jviereck/regjsparser/pull/83
  namedGroups: true,

  // SEE: https://github.com/jviereck/regjsparser/pull/89
  lookbehind: true
});
console.log(parseTree);

Testing

To run the tests, run the following command:

 npm test

To create a new reference file, execute…

 node test/update-fixtures.js

…from the repo top directory.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin