Skip to content

Releases: tom-lord/regexp-examples

Use `regexp_property_values` gem for accurate property mapping

20 May 18:53
Compare
Choose a tag to compare

See: #40

Replace usage of the unicode ranges pstore (which had not been updated for unicode 13.0 --> 15.1+!), with the regexp_property_values gem.

This fixes/improves various examples generation for named properties, including:

# Previously no list was stored, because data was outdated, so no examples could be generated:
/\p{Age=15.0}/.random_example #=> "䧖"

# Previously no list was stored, because the generator as flawed, so no examples could be generated:
/\p{In Miscellaneous Mathematical Symbols-B}/.random_example #=> "⦉"

# Previously the gem didn't handle space/hyphen padded property names, and only generated up to 128 examples:
/\p{Lowercase-Letter}/.examples(max_group_results:99999).count
=> 2155

Fix warnings caused by Ruby 2.7

09 Jan 09:21
Compare
Choose a tag to compare

Resolve deprecation warnings when using this gem with ruby 2.7 - See #37

Thanks @taichi-ishitani

Full ruby v2.6.3 support

13 Jul 09:54
Compare
Choose a tag to compare
  • Full ruby v2.6.3 support. (There were a few minor bugs introduced by the unicode version bump from 12.0.0 to 12.1.0.
  • Dropped support for ruby v2.0.0 - v2.3.x.
  • Fixed ability to generate examples for patterns like: /__xxx__/.
  • Added support for unicode range generation, e.g. /[\u4e00-\u9fa5]{2,4}/.random_example (@xiejiangzhi)

Ruby v2.6 compatibility

27 Dec 21:28
Compare
Choose a tag to compare

Generated unicode 11.0 ranges, as required for ruby v2.6.x compatibility.

Fix randomness regression

29 Jul 12:49
Compare
Choose a tag to compare

This release contains a significant fix to Regexp#random_example, as reported here: #21

There are also some minor additions/bug fixes

  • Added (limited) support for the absence operator.
  • Fixed back-reference group counter when using non-capture groups or comment groups. (This impacts regex example generation when the back-reference number is after one of the aforementioned group types.)

Ruby v2.5 compatibility

25 Dec 17:51
2d6d90d
Compare
Choose a tag to compare

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.

Bug fix - generating examples for an empty regex

09 Nov 20:17
Compare
Choose a tag to compare
//.examples # => ['']
//.random_example # => ''

In previous versions of the gem, running the above commands failed.

Configuration API and thread safety

15 Oct 20:58
Compare
Choose a tag to compare

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.

Minor fixes for ruby 2.4+

09 Nov 20:14
Compare
Choose a tag to compare

This release comes with two significant fixes:

  1. /[[: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.)
  2. /foo\Z/.examples will now return "foo" and "foo\n". This fixes a long-standing bug in the library.

Ruby v2.4.0 support

30 Dec 10:24
Compare
Choose a tag to compare

Updated the character set definitions, in light of the new v2.4.0 ruby release.