Skip to content

gjtorikian/ecma-re-validator

Repository files navigation

ecma-re-validator

Pass in a string to validate if it would work in ECMA-262, aka JavaScript.

The information for what is valid and what isn't comes from http://www.regular-expressions.info/javascript.html.

Usage

Pass in either a string or a Regexp:

require 'ecma-re-validator'

re = "[Ss]mith\\\\b"

EcmaReValidator.valid?(re) # true

re = /(?<=a)b/

EcmaReValidator.valid?(re) # false--lookbehinds don't exist in JS

About

Validate a regular expression against what ECMA-262 (JavaScript) can actually do.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •