Skip to content

Commit

Permalink
Bump version to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mudge committed Oct 16, 2022
1 parent a2209cc commit 75951ac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ project adheres to [Semantic Versioning](http://semver.org/).
Older versions are detailed as [GitHub
releases](https://github.com/mudge/re2/releases) for this project.

## [1.5.0] - 2022-10-16
### Added
- Added RE2::Set for simultaneously searching a collection of patterns

## [1.4.0] - 2021-03-29
### Fixed
- Fixed a crash when using RE2::Scanner#scan with an invalid regular expression
Expand Down Expand Up @@ -69,6 +73,7 @@ releases](https://github.com/mudge/re2/releases) for this project.
### Fixed
- In Ruby 1.9.2 and later, re2 will now set the correct encoding for strings

[1.5.0]: https://github.com/mudge/re2/releases/tag/v1.5.0
[1.4.0]: https://github.com/mudge/re2/releases/tag/v1.4.0
[1.3.0]: https://github.com/mudge/re2/releases/tag/v1.3.0
[1.2.0]: https://github.com/mudge/re2/releases/tag/v1.2.0
Expand Down
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ re2 [![Build Status](https://github.com/mudge/re2/actions/workflows/tests.yml/ba
A Ruby binding to [re2][], an "efficient, principled regular expression
library".

**Current version:** 1.4.0
**Current version:** 1.5.0
**Supported Ruby versions:** 1.8.7, 1.9.3, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0
**Supported re2 versions:** libre2.0 (< 2020-03-02), libre2.1 (2020-03-02), libre2.6 (2020-03-03), libre2.7 (2020-05-01), libre2.8 (2020-07-06), libre2.9 (2020-11-01)

Expand Down Expand Up @@ -131,6 +131,22 @@ enum.next #=> ["It"]
enum.next #=> ["is"]
```

As of 1.5.0, you can use `RE2::Set` to match multiple patterns against a
string. Calling `RE2::Set#add` with a pattern will return an integer index of
the pattern. After all patterns have been added, the set can be compiled using
`RE2::Set#compile`, and then `RE2::Set#match` will return an `Array<Integer>`
containing the indices of all the patterns that matched.

``` ruby
set = RE2::Set.new
set.add("abc") #=> 0
set.add("def") #=> 1
set.add("ghi") #=> 2
set.compile #=> true
set.match("abcdefghi") #=> [0, 1, 2]
set.match("ghidefabc") #=> [2, 1, 0]
```

Features
--------

Expand All @@ -149,6 +165,8 @@ Features

* Incrementally scanning text with `re2.scan(text)`

* Search a collection of patterns simultaneously with `RE2::Set`

* Checking regular expression compilation with `re2.ok?`, `re2.error` and
`re2.error_arg`

Expand Down Expand Up @@ -177,7 +195,9 @@ Contributions
* Thanks to [Sebastian Reitenbach](https://github.com/buzzdeee) for reporting
the deprecation and removal of the `utf8` encoding option in re2;
* Thanks to [Sergio Medina](https://github.com/serch) for reporting a bug when
using `RE2::Scanner#scan` with an invalid regular expression.
using `RE2::Scanner#scan` with an invalid regular expression;
* Thanks to [Pritam Baral](https://github.com/pritambaral) for contributed the
initial support for `RE2::Set`.

Contact
-------
Expand Down
3 changes: 2 additions & 1 deletion re2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = "re2"
s.summary = "Ruby bindings to re2."
s.description = 'Ruby bindings to re2, "an efficient, principled regular expression library".'
s.version = "1.4.0"
s.version = "1.5.0"
s.authors = ["Paul Mucur"]
s.homepage = "https://github.com/mudge/re2"
s.extensions = ["ext/re2/extconf.rb"]
Expand All @@ -24,6 +24,7 @@ Gem::Specification.new do |s|
"spec/re2/regexp_spec.rb",
"spec/re2/match_data_spec.rb",
"spec/re2/string_spec.rb",
"spec/re2/set_spec.rb",
"spec/re2/scanner_spec.rb"
]
s.add_development_dependency("rake-compiler", "~> 0.9")
Expand Down

0 comments on commit 75951ac

Please sign in to comment.