On Mon, 10 Dec 2007 19:50:09 -0500, Michal Suchanek wrote: > On 11/12/2007, Joe <qbproger / gmail.com> wrote: >> /(.*?)(.)(.(?:..)+?)\2(.*)/i >> >> break it up: >> (.*?) looks for a non-greedy string of anything (.) any character >> (.(?:..)+?) non-greedy matching of an odd number of characters. I'm >> not sure what the ?: adds to the regular expression. I got this: "(?: ) >> grouping without backreferences" from here: >> http://www.zenspider.com/Languages/Ruby/QuickRef.html#11 > > Yes, makes sense. This group would not be used in the match result. > >> \2 matches the any character from before > > I wonder if these are still regular epxpressions with those > backreferences. They're not. They're not even necessarily context-free anymore (although in this case it still is --- since the backreference can only ever match something of finite length, we can enumerate all possibilities as seperate rules in a CFG). --Ken -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/