Low commit activity in last 3 years
A long-lived project that still receives updates
Validate a regular expression string against what ECMA-262 can actually do.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

ecma-re-validator

Build Status

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