zombor/Validator — pull request #13 by olivierdagenais (2013-12-18 14:55:21+00:00)
Title: Add RegularExpression and simple spec

It is now possible to use a rule that validates against a regular expression.

Sample usage:
```
require "validation"
require "validation/rule/regular_expression"

(...)
rule :zip_code, :regular_expression => {:regex => /\A[0-9]{5}(-[0-9]{4})?\Z/}
```

Notice that a `nil` will be considered valid, to allow a field to be optional. A required field is what the `:not_empty` rule was invented for.