RegExpBuilder Demo

Repository: https://github.com/thebinarysearchtree/regexpbuilderjs See also: https://news.ycombinator.com/item?id=9033146

by klenwell

HTML

<script src="https://rawgit.com/thebinarysearchtree/regexpbuilderjs/master/regexpbuilder.js"></script>
<h4>Open console to see results.</h4>

JavaScript

var r = new RegExpBuilderFactory();

var regex = r
  .find("$")
  .min(1).digits()
  .then(".")
  .digit()
  .digit()
  .getRegExp();

console.debug(regex.test("$10.00")); // true
console.debug(regex);