[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] oniguruma 1.0.0 Released

Dizan Vasquez

3/27/2007 6:18:00 PM

oniguruma version 1.0.0 has been released!

http://oniguruma.rub...

Ruby bindings to the
Oniguruma[http://www.geocities.jp/kosako3/...] 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('(?<pre>\w+)\d+(?<after>\w+)').sub('abc123def',
'\<after>123\<pre>') #=> 'def123abc'
* couple of bugfixes with region's num_regs
* some docs for substitution methods added

2 Answers

WoNáDo

3/27/2007 7:29:00 PM

0

Dizan Vasquez schrieb:
> oniguruma version 1.0.0 has been released!
>
> http://oniguruma.rub...
>
> Ruby bindings to the
> Oniguruma[http://www.geocities.jp/kosako3/...] 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

Dizan Vasquez

3/28/2007 3:15:00 PM

0

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