Generate strings that match a given regular expression
Resolve deprecation warnings when using this gem with ruby 2.7 - See https://github.com/tom-lord/regexp-examples/pull/37
Thanks @taichi-ishitani
v2.6.3
support. (There were a few minor bugs introduced by the unicode version bump from 12.0.0
to 12.1.0
.v2.0.0
- v2.3.x
./__xxx__/
./[\u4e00-\u9fa5]{2,4}/.random_example
(@xiejiangzhi)Generated unicode 11.0 ranges, as required for ruby v2.6.x
compatibility.
This release contains a significant fix to Regexp#random_example
, as reported here: https://github.com/tom-lord/regexp-examples/issues/21
There are also some minor additions/bug fixes
Generated unicode 10.0 ranges, as required for ruby v2.5.x
compatibility.
This ensures code such as:
/\p{Alpha}/.random_example
will generate a matching example under the new ruby version.
//.examples # => ['']
//.random_example # => ''
In previous versions of the gem, running the above commands failed.
This release comes with two significant fixes:
/[[:punct:]]/.examples
can now return all possible characters for ruby 2.4.0+. (The definition of this character set has changed in the latest minor ruby version.)/foo\Z/.examples
will now return "foo" and "foo\n". This fixes a long-standing bug in the library.Configuration options can now be made globally, e.g.
RegexpExamples::Config.max_repeater_variance = 5
RegexpExamples::Config.max_group_results = 10
RegexpExamples::Config.max_results_limit = 20000
Or within a block, e.g.
RegexpExamples::Config.with_configuration(max_repeater_variance: 5) do
# ...
end
All forms of configuration are now thread safe.
Following a raised issue, the gem no longer uses symbolic links to simplify cross-version unicode mappings.
There should be no functional change resulting from this release.
Updated the character set definitions, in light of the new v2.4.0
ruby release.