#78 sre: (** 0 0 "foo") raises error

closed
Mike Sperber
None
5
2004-08-22
2004-08-07
Eric Knauel
No

The manual (section 6.4) states that

(** 0 0 "foo")

matches the empty string. In fact, using this regular expression
raises an error:

[0 knauel@galibier ~] ledit scsh
Welcome to scsh 0.6.6 (King Conan)
Type ,? for help.
> (string-match (rx (** 0 0 "foo")) "")

Error: Posix regexp () : empty (sub)expression
#{Regexp}
1>

A repetition form ** with the arguments 0 and 0 is mentioned on
several other occasions in section 6.4.

This bug/behavior was noted by Christoph Hetz.

Discussion

    • assigned_to: nobody --> sperber
     
  • Mike Sperber
    Mike Sperber
    2004-08-22

    • status: open --> closed
     
  • Mike Sperber
    Mike Sperber
    2004-08-22

    Logged In: YES
    user_id=43931

    Fix in the 0.6 branch. (The reason is that POSIX doesn't
    accept "" to mean "the regexp matching the empty string"
    but requires "()". Which is a pain.