quoted-string-regex
JavaScript regular expression for matching a quoted string.
Originally posted here.
Install
Install with npm
$ npm i quoted-string-regex --save
Usage
var regex = require('quoted-string-regex');
('var foo = \'bar\';').match(regex());
('var foo = "bar";').match(regex());
('var foo = "bar";\nvar bar = \'baz\'').match(regex());
('foo bar ". // \' \\ . // \' \\ ." baz').match(regex());
Related projects
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
This file was generated by verb-cli on November 02, 2015.