Skip to content

Compiles a string, RegExp instance, file, or stream to ecma script. Supports ECMA5, ECMA2016 and 2017 features as wellas multiple flavors of regular expressions

License

Notifications You must be signed in to change notification settings

LaughingSun/buffer-regexp-compiler-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

buffer-regexp-compiler-js

Compiles a string or RegExp instance to ecma-script for use with buffers.
Supports ECMA5, ECMA2016, 2017 and PERL features as well as all popular flavors of regular expressions.

installations:

> npm install buffer-regexp-compiler-js          # for node script project use
> npm install buffer-regexp-compiler-js -save    # for node cli and script project use
> npm install buffer-regexp-compiler-js -global  # for node cli and script global use

cli use:

regexp-compiler '(\\w+)' --flags=g
regexp-compiler --source='source.js'

module use:

const CRegExp = require( 'regexp-compiler.js' )
    .ClassFactory( { flavor: 'PERL', library: library } );

with

cre = new RegExpCompiler.RegExp( /(\w+)/ );

or

cre = new RegExpCompiler.RegExp( '(\\w+)', 'g' );

or

cre = new RegExpCompiler.RegExp( ).compile( '(\\w+)'
    , { global: true } );

or

CRegExp = RegExpCompiler.classFactory( { flavor: 'PERL', library: library } );
cre = new CRegExp( /(\w+)/ );

browser use:

<script src="https://github.com/LaughingSun/buffer-regexp-compiler-js/build/regexp-compiler-min.js"></script>

or

<script src="https://github.com/LaughingSun/buffer-regexp-compiler-js/build/regexp-compiler.js"></script>

or

<script type="module" src="https://github.com/LaughingSun/buffer-regexp-compiler-js/build/regexp-compiler-min.js"></script>

or

<script type="module" src="https://github.com/LaughingSun/buffer-regexp-compiler-js/build/regexp-compiler.js"></script>

with

<script>
cre = new RegExpCompiler.RegExp( /(\w+)/ );
</script>

or

<script>
cre = new RegExpCompiler.RegExp( '(\\w+)', 'g' );
</script>

or

<script>
cre = new RegExpCompiler.RegExp( ).compile( '(\\w+)', { global: true } );
</script>

or

<script>
CRegExp = RegExpCompiler.ClassFactory( { flavor: 'PERL', library: library } );
cre = new CRegExp( /(\w+)/ );
</script>

About

Compiles a string, RegExp instance, file, or stream to ecma script. Supports ECMA5, ECMA2016 and 2017 features as wellas multiple flavors of regular expressions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published