A Liquid filter to perform regex match
Ruby Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin feat: init gem Nov 29, 2016
lib feat: add module Nov 29, 2016
spec feat: init gem Nov 29, 2016
.gitignore chore: update ignore list Nov 29, 2016
.rspec fix: missing dot files Nov 29, 2016
.travis.yml fix: missing dot files Nov 29, 2016
CODE_OF_CONDUCT.md feat: init gem Nov 29, 2016
Gemfile feat: init gem Nov 29, 2016
LICENSE.txt feat: init gem Nov 29, 2016
README.md fix: missing dot files Nov 29, 2016
Rakefile feat: init gem Nov 29, 2016
match_regex.gemspec fix not allowed pushing Nov 29, 2016

README.md

MatchRegex

A Liquid filter to perform regex match

Installation

Add this line to your application's Gemfile:

gem 'match_regex'

And then execute:

$ bundle

Or install it yourself as:

$ gem install match_regex

Usage

{{ '<img class="image" src="my-pic.jpg">' | match_regex: '<img .*?src="([^"]+)"' }}

Will output my-pic.jpg.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sparanoid/match_regex. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.