# Oniguruma 1.0.0 Released

**URL:** <https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321>\
**Category:** Ruby\
**Created:** [March 27, 2007, 8:19pm UTC](https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321 "2007-03-27T20:19:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dizan\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@Dizan\_V](https://www.ruby-forum.com/u/Dizan_V)\
**Post date:** [March 27, 2007, 8:19pm UTC](https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321/1 "2007-03-27T20:19:30Z")

</div>

oniguruma version 1.0.0 has been released!

[http://oniguruma.rubyforge.org](http://oniguruma.rubyforge.org)

Ruby bindings to the  
Oniguruma[[http://www.geocities.jp/kosako3/oniguruma/](http://www.geocities.jp/kosako3/oniguruma/)] regular  
expression library (no need to recompile Ruby).

Changes:

== 1.0.0 / 2007-03-27

- Added documentation for MatchData.
- Added ogsub, ogsub!, sub and sub! to ::String.
- Removed ::String definitions from tests.
- Now the minimal recommended version of oniglib is 5.5 or higher.
- Removed ugly #if statements from c code.
- Do not create @named\_captures hash if there are no named groups for  
regexp – somewhat improve speed for repetive calls
- Fixed usage of named backreferences in gsub with non-ascii names
- Move ORegexp#=~ to C code, make it work just like Regexp#=~, i.e.  
set $~. Throw ArgumentError instead of Exception if pattern does not  
compile
- Fix implementation of ORegexp#===, so it now does not raise errors  
in case statement anymore  
(resembles plain Ruby Regexp#=== behaviour)
- Modified begin, end and offset methods in MatchData to handle named  
groups and default to group 0.
- Exception is not longer thrown when in oregexp\_make\_match\_data.
- Removed references to MultiMatchData from documentation
- Removed class MultiMatchData
- Fix off by one error in region-\>num\_regs usage
- Fix dumb bug with zero-width matches that made infinite loops. now  
consume at least one char in gsub and scan
- ORegexp API changes:
  - Pass only MatchData to sub/gsub with blocks  
oregexp.sub( str ) {|match\_data| … }  
oregexp.gsub( str ) {|match\_data| … }
  - Add ORegexp#scan instead of match\_all  
oregexp.scan(str) {|match\_data| … } # =\> MultiMatchData
  - Friendly way to set options  
ORegexp.new( pattern, options\_str, encoding, syntax)  
ORegexp.new(‘\w+’, ‘imsx’, ‘koi8r’, ‘perl’)
  - Named backreferences in substitions  
ORegexp.new(‘(?
```
\w+)\d+(?\w+)’).sub(‘abc123def’,
‘<after>123<pre>’) #=> ‘def123abc’
```

- couple of bugfixes with region’s num\_regs
- some docs for substitution methods added

---

<div class="post-metadata">

**Author:** ![Dizan\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@Dizan\_V](https://www.ruby-forum.com/u/Dizan_V)\
**Post date:** [March 27, 2007, 9:30pm UTC](https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321/2 "2007-03-27T21:30:40Z")

</div>

Dizan V. schrieb:

> oniguruma version 1.0.0 has been released!
> 
> [http://oniguruma.rubyforge.org](http://oniguruma.rubyforge.org)
> 
> Ruby bindings to the  
> Oniguruma[[サービス終了のお知らせ](http://www.geocities.jp/kosako3/oniguruma/)] regular  
> expression library (no need to recompile Ruby).
> 
> Changes:
> 
> - Now the minimal recommended version of oniglib is 5.5 or higher.

You are very fast, but my general question is still valid.

The library should support Oniguruma-4 versions, because they will be  
used in  
Ruby, starting with version 1.9, while Oniguruma-5 is not related to  
Ruby. If  
one wants to use the pattern matching capabilities of Ruby 1.9, but  
still have  
problems with libraries, that are not yet ported to Ruby 1.9, needs the  
regular  
expression engine of Ruby 1.9 in Ruby 1.8 to avoid later porting  
problems for  
the own software.

Wolfgang Nádasi-Donner

---

<div class="post-metadata">

**Author:** ![Dizan\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@Dizan\_V](https://www.ruby-forum.com/u/Dizan_V)\
**Post date:** [March 28, 2007, 12:25am UTC](https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321/3 "2007-03-28T00:25:23Z")

</div>

2007/3/27, Wolfgang NÃ¡dasi-Donner [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> The library should support Oniguruma-4 versions, because they will be used in  
> Ruby, starting with version 1.9, while Oniguruma-5 is not related to Ruby. If  
> one wants to use the pattern matching capabilities of Ruby 1.9, but still have  
> problems with libraries, that are not yet ported to Ruby 1.9, needs the regular  
> expression engine of Ruby 1.9 in Ruby 1.8 to avoid later porting problems for  
> the own software.

Hi, Wolfgang!

As for me, the most notable difference between 4.x and 5.x versions of  
Oniguruma is extended support for Unicode in the latter, especially  
casefolding for full character repertoire. The only definition missing  
is for CP1251 encoding (just comment it out in source and build for  
your own:), yep, that #ifdef perhaps should be in 1.0.1 release ),  
rest of the code does not rely on some special features of 5.x missing  
in 4.x series.

Next, Ruby 1.9 is a moving target, so before the great day of 2.0  
appearance (that is really soon, at least one year from now, though),  
several changes can happen, and even now there can be other  
discrepancies with regexp usage in 1.9 and “oniguruma for ruby” (if  
you find out them, drop a note to rubyforge tracker for the project).

Besides, I expect some compilation failures with microsoft visual C  
compilers, but don’t have one at present, so if you find problems with  
that, please report.

WBR,  
Nikolai, co-developer of Oniguruma for Ruby.

---

<div class="post-metadata">

**Author:** ![Dizan\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@Dizan\_V](https://www.ruby-forum.com/u/Dizan_V)\
**Post date:** [March 28, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/oniguruma-1-0-0-released/90321/4 "2007-03-28T17:18:18Z")

</div>

Hi Wolfgang,

> your own:), yep, that #ifdef perhaps should be in 1.0.1 release ),

Version 1.0.1 has been released, between other changes, it now  
requires libonig v.4.4 as a minimum.

Dizan
