cregularity
Version, currently 0.1.01 version
- 0.1.0latestOct 13, 2018
github.com/spencerwi/Cregularity
A Crystal port of the Regularity gem
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
cregularity:
github: spencerwi/Cregularity
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
0.26.1- License
- MIT
- Author
- spencerwi
Dependencies
This version declares no dependencies.
README
Cregularity
A Crystal port of andrewberls's Regularity gem for Ruby.
Installation
Add this to your application's shard.yml:
dependencies:
cregularity:
github: spencerwi/cregularity
Usage
The API basically mirrors the Regularity gem, though you instantiate it as Cregularity.new.
To borrow one of the original gem's examples:
require "cregularity"
re = Cregularity.new
.start_with(3, :digits)
.then("-")
.then(2, :letters)
.maybe("#")
.one_of(["a", "b"])
.between([2,4], "a")
.end_with("s")
if (re =~ "123-ff#baaas")
puts "It works!"
end
Development
To run tests:
$ crystal spec
Contributing
- Fork it (https://github.com/spencerwi/cregularity/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- spencerwi - creator, maintainer
- andrewberls - the developer of the original gem
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Oct 13, 2018
- Commit
136d5fe7f633- Crystal
0.26.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/spencerwi/Cregularity
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1