From: Hugh Sasse Staff Elec Eng Date: 2003-12-03T23:46:03+09:00 Subject: Re: Some Regexp On Wed, 3 Dec 2003, Robert Klemme wrote: > > "Hugh Sasse Staff Elec Eng" schrieb im Newsbeitrag > news:Pine.GSO.4.58.0312031220260.10895@neelix... > > > > Interesting. This doesn't cope with nesting though. I've just > > tried that out. Is there a good way to do that with scan? > > Do you mean nesting of TEXT1...TEXT2 sections within each other? That Yes. > can't be done with regexps. You need a context free parser for that. Is this a limitation inherent in regexps, or just as they are implemented now? I ask, because Lua (which uses % where we use \ for things like \w, \d etc) has %bxy which matches a balanced x y pair and its contents. Eg %b() would match the whole of "(an (example))". The delimiters being one character only couldn't make a difference here, or could it? > > Cheers > > robert Hugh