From: Seth Thomas Rasmussen Date: 2006-07-13T22:20:08+09:00 Subject: Re: Help with a regexp Hi Daniel, Daniel Schierbeck wrote: > I'm trying to write a regular expression that matches bencoded strings, > i.e. strings on the form x:y, where x is the numeric length of y. > > This is valid: > > 6:foobar > > while this is not: > > 4:foo > > I've tried using #{$1} inside the regexp, but it seems $1 is still nil > at that point. I think you can do what you want there, but if you're using captures within the regex they are captured in, you denote them as \1, \2, etc. %r{<(foo)>} # should match a pair of empty "foo" tags Peas, --- Seth Thomas Rasmussen http://sethrasmussen.com