From: Josh Cheek Date: 2011-02-01T17:55:44+09:00 Subject: Re: Recursive regular expressions in Ruby? --00163630f5f38d1bce049b34b21f Content-Type: text/plain; charset=ISO-8859-1 On Tue, Feb 1, 2011 at 2:50 AM, Jarmo Pertman wrote: > Thanks! > > It seems that you've given wrong link as i've unable to find anything > regarding "regular expressions" in that pdf. > > Jarmo > > On Feb 1, 5:34 am, Josh Cheek wrote: > > On Mon, Jan 31, 2011 at 5:05 PM, Jarmo Pertman > wrote: > > > Hi! > > > > > I was just wondering if there is possible to write recursive regular > > > expressions in Ruby? As i'm understanding at this moment then there > > > isn't. Prove me wrong. > > > > > If you're not aware of such possibility in Perl for example then here > > > is one good blog post about it > > >http://www.catonmat.net/blog/recursive-regular-expressions > > > > > It seems that also PHP has such a functionality. > > > > > Jarmo > > > > 1.9.2 has it, here is an example: > > > > regex = /^(?\[(\g|\d)\])$/ > > '1'.match regex # => nil > > '[1]'.match regex # => # > > '[[1]]'.match regex # => # > > '[[[1]]]'.match regex # => # > > > > I found it in the Christmas edition of PragPub ( > http://pragprog.com/magazines/download/19.PDF) they talk about it more in > > depth, as well, if you want more info. > > You're right, that was the January edition. Here is the one I meant to link to, Dec 2010 http://pragprog.com/magazines/download/18.PDF It is in section "what's new in Ruby 1.9.2" on page 24 --00163630f5f38d1bce049b34b21f--