emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extended rx.el


From: Dave Love
Subject: Re: extended rx.el
Date: Mon, 26 Apr 2004 15:21:03 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

Richard Stallman <address@hidden> writes:

> It sounds like a good idea to simplify these two packages into one.
> Could you explain more about how `repeat' is more restricted in rx?

In Rx:

`(repeat N SEXP)'
     matches N occurrences of what SEXP matches.

`(repeat N M SEXP)'
     matches N to M occurrences of what SEXP matches.

In Sregex:

;; - (repeat MIN MAX CLAUSE ...)
;;   Concatenates the given CLAUSEs and constructs a regex matching at
;;   least MIN occurrences and at most MAX occurrences.  MIN must be a
;;   non-negative integer.  MAX must be a non-negative integer greater
;;   than or equal to MIN; or MAX can be nil to mean "infinity."

Since a character is a valid SEXP/CLAUSE, if you try to unify them,
you can't disambiguate `(repeat N M SEXP ...)' from
`(repeat N CHARACTER SEXP ...)', so the Rx version of `repeat' can't
allow multiple SEXP args.  I added SRE's `**', which is like Sregex's
`repeat'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]