Search this site


Metadata

Articles

Projects

Presentations

Ruby/Oniguruma code block patches

I love perl's (?{ code }) feature. I want it in other languages.

I spent some time on hacking this into ruby a few weeks ago. I finally got around to making patches.

In FreeBSD ports, I select to build Ruby 1.8.6 with oniguruma for the regex engine. After doing 'make configure' you can apply these patches:

I haven't tested this on other platforms, and it's not feature complete, but it's close.

2 responses to 'Ruby/Oniguruma code block patches'

Showing last 2 comments... (Click here to view all comments)

Dong wrote at Sun Sep 30 12:18:50 2007...
Can you provide a link documenting the original Perl feature that this is modeled after?  I've got a perl interpreter but I don't know how to use it well enough to decipher (?{ code }).  TY

Jordan Sissel wrote at Sun Sep 30 13:36:04 2007...
perldoc perlre, look for (?{ code })
  "(?{ code })"
  WARNING: This extended regular expression feature is considered
  highly experimental, and may be changed or deleted without
  notice.
etc...


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment: