Low commit activity in last 3 years
No release in over a year
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
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

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