From: Wayne Magor Date: 2007-11-21T23:11:17+09:00 Subject: Re: Regexp for parsing? Noah Easterly wrote: > On Nov 18, 8:50 pm, Wayne Magor wrote: >> I understand regular expressions, but can someone please explain this: >> >> re = %r/((?\((?:\\[()]|[^()]|\g)*\)))/ snip > (?: ... | ... | ... )* > -- non-capturing group of 3 alternatives, repeated 0 or more times > \\[()] > -- escaped literal parens > [^()] > -- anything except parens > \g > -- match the pg-named pattern here Ok, so there are 3 alternatives in the non-capturing group: 1. An open or close parenthesis 2. Any character except a paren 3. A pattern that starts with an open paren Am I the only one that finds this strange? -- Posted via http://www.ruby-forum.com/.