From: Robert Klemme Date: 2011-02-22T17:17:54+09:00 Subject: Re: Regular Expression help - Replacing Regexp that worked with Oniguruma in 1.8.6 On Mon, Feb 21, 2011 at 5:40 PM, Zeno R.R. Davatz wrote: > Dear Robert > > On 21 Feb., 03:15, Robert Klemme wrote: >> On Sun, Feb 20, 2011 at 8:31 PM, Zeno Davatz wrote: >> > On our way to shifting to Ruby 1.8.7 - away from the beloved >> > Oniguruma-Patch - I am tripping over our usefull regular expression used >> > in Ruby 1.8.6 - so if anybody is strong in refactoring regular >> > expressions, please let me know. >> >> > sample one: >> >> >http://choddb.rubyforge.org/ODDB/SwissmedicPlugin.html >> >> > %r{excipiens\s+(ad|pro)\s+(?((?!\bpro\b)[^.])+)}u >> >> > and >> >> > %r{pro\s+(?(?[\d.,]+)\s*(?[kcmuµn]?[glh]))}u >> >> > And this one on line 148 >> >> >http://url.ba/kxez >> >> > All three samples need to work in Ruby 1.8.7 and in 1.9.2. >> >> > They currently work perfectly fine in Ruby 1.8.6 with the beloved >> > Oniguruma-Patch V2.5.9 >> >> > Any hints or Feedback is welcome. >> >> Can you give hints about what exactly you are asking?  Do you have >> syntax errors, do the expressions not match?  What is the reason for >> your posting? > > Basically our software does not start-up with Ruby 1.8.7 and with Ruby > 1.9.2 as Oniguruma is missing. Since when is Oniguruma missing from 1.9.2??? 09:14:24 ~$ for e in ruby ruby19; do $e -v; $e -ce '/(?)/'; done ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] -e:1: undefined (?...) sequence: /(?)/ ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-cygwin] Syntax OK 09:14:33 ~$ If you migrate away from 1.8.6 then why do you switch to 1.8.7 and not 1.9.* which is significantly faster *and* has Oniguruma? >> Ideally you would provide sample code and text to match. > > Ok, I will try to produce these beyond what I already supplied above. Yes, I think you should do that. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/