GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AuxControl/SRL-JavaScript at 28ce8dbe2b63f208b1e3d71649ea60370cbbbac8

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

SRL-JavaScript

JavaScript implementation of Simple Regex 🎉🎉🎉

npm version Build Status codecov

Because of the JavaScript regex engine, there is something different from Simple Regex

  • NOT support as to assign capture name.
  • NOT support if already had/if not already had
  • NO firstMatch, since in JavaScript lazy means non-greedy (matching the fewest possible characters).

Installation

npm install srl

Usage

Class SRL accepts a Simple Regex Language string as input, and return the builder for the query.

The builder can agent test/exec method to the generated regex object. Or you can use get() to take the generated regex object.

const SRL = require('srl')
const query = new SRL('letter exactly 3 times')
const regex = query.get() // /[a-z]{3}/

query.test('aaa') // true
query.exec('aaa') // [ 'aaa', index: 0, input: 'aaa' ]

query
    .digit()
    .neverOrMore()
    .mustEnd()
    .get() // /[a-z]{3}[0-9]*$/

Required Node 6.0+ for the ES6 support, Or you can use Babel to support Node below 6.0.

Using Webpack and babel-loader to pack it if want to use in browsers.

Development

First, clone repo and init submodule for test.

SRL-JavaScript depends on Mocha and Istanbul to test code. You can use them like this:

npm install

npm test # test 
npm run coverage # Get coverage locally 

How to write Rules, see: Test-Rules.

License

SRL-JavaScript is published under the MIT license. See LICENSE for more information.

About

JavaScript implementation of SRL.

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.