Ruby to JavaScript regular expression converter
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.reek
.rubocop.yml
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
jsregexp.gemspec

README.md

JSRegexp

Gem Version Build Status

JSRegexp is a converter from Ruby Regexp to valid JavaScript RegExp format

Installation

Add this line to your application's Gemfile:

gem 'jsregexp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jsregexp

Usage

JSRegexp.convert(/\Afoo/)   # => '^foo'
JSRegexp.convert('/\Gbar/') # => '^bar'
JSRegexp.convert('baz\Z')   # => 'baz$'

License

BSD-3-Clause