Regular Expression help - Replacing Regexp that worked with Oniguruma in 1.8.6

Hi

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+(?<galform>((?!\bpro\b)[^.])+)}u

and

%r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u

And this one on line 148

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.

Best
Zeno

···

--
Posted via http://www.ruby-forum.com/.

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?

Ideally you would provide sample code and text to match.

Cheers

robert

···

On Sun, Feb 20, 2011 at 8:31 PM, Zeno Davatz <zdavatz@gmail.com> 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+(?<galform>((?!\bpro\b)[^.])+)}u

and

%r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u

And this one on line 148

Url.ba

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.

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Good Afternoon,

···

On Sun, Feb 20, 2011 at 11:31 AM, Zeno Davatz <zdavatz@gmail.com> wrote:

Hi

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.

Could you provide some samples of inputs and what you expect/are getting out
of the expressions. Rather difficult to ensure one can be of assistance
without knowing the specific targets.....

John

Dear Robert

> 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+(?<galform>((?!\bpro\b)[^.])+)}u

> and

> %r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u

> And this one on line 148

>Url.ba

> 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.

Ideally you would provide sample code and text to match.

Ok, I will try to produce these beyond what I already supplied above.

Best
Zeno

···

On 21 Feb., 03:15, Robert Klemme <shortcut...@googlemail.com> wrote:

On Sun, Feb 20, 2011 at 8:31 PM, Zeno Davatz <zdav...@gmail.com> wrote:

He's just taking another opportunity to complain that a patch that he privately applied to 1.8.6 wasn't applied to 1.8.7 or 1.9. Instead of either sticking to what he likes or migrating his code (in this case named groups--really not hard if he'd just think about it), he's complaining. Again. Ad nauseum. Just like he did on ruby-core@.

···

On Feb 21, 2011, at 00:15 , Robert Klemme wrote:

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?

Dear Robert

> 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+(?<galform>((?!\bpro\b)[^.])+)}u

> and

> %r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmuµn]?[glh]))}u

> And this one on line 148

>Url.ba

> 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 '/(?<name>)/'; done
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
-e:1: undefined (?...) sequence: /(?<name>)/
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

···

On Mon, Feb 21, 2011 at 5:40 PM, Zeno R.R. Davatz <zdavatz@gmail.com> wrote:

On 21 Feb., 03:15, Robert Klemme <shortcut...@googlemail.com> wrote:

On Sun, Feb 20, 2011 at 8:31 PM, Zeno Davatz <zdav...@gmail.com> wrote:

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/