Skip to content
Convert a Ruby range to a regexp.
Branch: master
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
test
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
range_regexp.gemspec

README.md

Transform Ruby ranges to regexps

The solution to convert a Ruby Range to a Regexp

Install

In the system:

gem install range-regexp

or add the gem to the Gemfile:

gem 'range-regexp'

and then run bundle install.

Usage

converter = RangeRegexp::Converter.new(-9..9)
converter.convert # => /-[1-9]|\d/
You can’t perform that action at this time.