Regular Expression help - Replacing Regexp that worked withOniguruma in 1.8.6

Z

Zeno Davatz

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=C2=B5n]?[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.

Best
Zeno

-- =

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

Robert Klemme

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=B5n]?[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?

Ideally you would provide sample code and text to match.

Cheers

robert


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

Zeno R.R. Davatz

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:
%r{excipiens\s+(ad|pro)\s+(?<galform>((?!\bpro\b)[^.])+)}u
%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.

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
 
R

Ryan Davis

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?

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

John W Higgins

[Note: parts of this message were removed to make it a legal post.]

Good Afternoon,

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
 
R

Robert Klemme

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 us= ed
in Ruby 1.8.6 - so if anybody is strong in refactoring regular
expressions, please let me know.
sample one:
%r{excipiens\s+(ad|pro)\s+(?<galform>((?!\bpro\b)[^.])+)}u
%r{pro\s+(?<scale>(?<qty>[\d.,]+)\s*(?<unit>[kcmu=B5n]?[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.

Can you give hints about what exactly you are asking? =A0Do you have
syntax errors, do the expressions not match? =A0What 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?
Ok, I will try to produce these beyond what I already supplied above.

Yes, I think you should do that.

Kind regards

robert

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top