# Re: Named backreferences with Oniguruma

**URL:** <https://www.ruby-forum.com/t/re-named-backreferences-with-oniguruma/100178>\
**Category:** Ruby\
**Created:** [July 27, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/re-named-backreferences-with-oniguruma/100178 "2006-07-27T16:33:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [July 27, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/re-named-backreferences-with-oniguruma/100178/1 "2006-07-27T16:33:50Z")

</div>

> Daniel B. wrote in [ruby-talk:204267]:
> 
> > > > I’m trying to figure out how to get at named backreferences with  
> > > > Oniguruma, but I’m having some problems figuring it out. Here’s  
> > > > the interface I would _like_ to have:
> > > 
> > > MatchData#[] in 1.8 doesn’t take symbols.
> > 
> > Couldn’t it be added? I mean, it’s a custom re.c anyway, isn’t it?
> 
> To which? Oniguruma doesn’t contain the patch for 1.8?

To 1.8.x. I guess I’m a little confused. If I’ve installed Oniguruma  
properly, should MatchData#[] allow symbols or not for 1.8.x?

Thanks,

Dan

This communication is the property of Qwest and may contain confidential  
or  
privileged information. Unauthorized use of this communication is  
strictly  
prohibited and may be unlawful. If you have received this communication  
in error, please immediately notify the sender by reply e-mail and  
destroy  
all copies of the communication and any attachments.

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [July 27, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/re-named-backreferences-with-oniguruma/100178/2 "2006-07-27T16:54:10Z")

</div>

Hi,

At Thu, 27 Jul 2006 23:30:39 +0900,  
Berger, Daniel wrote in [ruby-talk:204281]:

> To 1.8.x. I guess I’m a little confused. If I’ve installed Oniguruma  
> properly, should MatchData#[] allow symbols or not for 1.8.x?

No, Oniguruma contains the patch for ruby 1.8.4, but it’s only  
for just replacement old regexp engine. Named capture is  
relatively newer feature so you’d have to ask Kosako-san.  
Possibly, it might work by copying re.c from 1.9, though I  
haven’t tried it.
