Re: [?] Closure variables in regular expressions
27 Jun 1999 00:02:42 -0400

          From comp.compilers

Related articles
[?] Closure variables in regular expressions (Quinn Tyler Jackson) (1999-06-19)
Re: [?] Closure variables in regular expressions (1999-06-27)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 27 Jun 1999 00:02:42 -0400
Organization: - Share what you know. Learn what you don't.
References: 99-06-071
Keywords: lex, comment

    "Quinn Tyler Jackson" <> wrote:
> There are regular expression extensions that do this:
> [a-z]{1-32}
> Has anyone ever seen regular expression extensions that work like
> [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 '%'...
> Any pointers to theory to suggest this would be useful or useless?

Forgive my ignorance if need be... It seems to me that there is a
difference between your example of existing extensions and your
proposed extension. [a-z]{1-32} represents a regular language whereas
I would have thought that [a-z]+:n%{n} does not. One can construct a
DFA which recognises the first expression, but I have a feeling that a
PDA would be needed to recognise the second. Thus the theory you seek
is probably that of higher order languages and their grammars.

Apologies if I'm talking nonsense, or if I've missed the point

All the best

[You're right. DFAs can't match parens or do any other counting. -John]

Post a followup to this message

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