[?] Closure variables in regular expressions

"Quinn Tyler Jackson" <qjackson@wave.home.com>
19 Jun 1999 17:49:38 -0400

          From comp.compilers

Related articles
[?] Closure variables in regular expressions qjackson@wave.home.com (Quinn Tyler Jackson) (1999-06-19)
Re: [?] Closure variables in regular expressions jonathan_barker@my-deja.com (1999-06-27)
| List of all articles for this month |

From: "Quinn Tyler Jackson" <qjackson@wave.home.com>
Newsgroups: comp.compilers
Date: 19 Jun 1999 17:49:38 -0400
Organization: Compilers Central
Keywords: lex, question, comment

There are regular expression extensions that do this:


        [a-z]{1-32}


        and this


        abc{5+}


Has anyone ever seen regular expression extensions that work like this?


        [a-z]+:n %{n}


What this would do is match 1 to many from the character set 'a-z',
and store how many times it did so into n. Then, it would match only
that many of the literal '%'...


Like this:


        abc %%%


        abcdefg %%%%%%%


But not:


        abc %%


or:


        abcdefg %%%%


Any pointers to theory to suggest this would be useful or useless?
--
Quinn Tyler Jackson
http://www.qtj.net/~quinn/
[Looks like it's equivalent in power to backreferences, which can also
count matching pairs of things. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.