Subject: REGEXP package brokenness?

From: Erik Arneson <[email-masked]>
Date: Fri, 1 Oct 1999 08:52:26 -0700 (PDT)

Howdy y'all,

I'm using the regexp package to parse data, but it doesn't seem to be
behaving very well.  Here's an example:

;; I don't believe \\b should match the space after 'Bob', as it matches
;; word boundaries, not spaces.
[70]> (setf test "Bob is a frog")
"Bob is a frog"
[71]> (setf sm (regexp:match "^[^:space:]\\+\\b" test))
#S(REGEXP::REGMATCH_T :RM_SO 0 :RM_EO 4)
[72]> (regexp:match-string test sm)
"Bob "

;; This is even stranger.  It should stop right after Bob, I believe.
[73]> (setf sm (regexp:match "^[^:space:]\\+" test))
#S(REGEXP::REGMATCH_T :RM_SO 0 :RM_EO 5)
[74]> (regexp:match-string test sm)
"Bob i"

Again, I'm using the 09-30 snapshot.  Is this all expected behavior?  It 
doesn't seem to me that it's working correctly.

-- 
# Erik Arneson      [email-masked]    Webring Software Engineer #
# Yahoo! Inc.      PGP ID: 2048/84413E19        (541) 482-3000x114 #
# "There's such a fine line between stupid and clever." Spinal Tap #

---

From: Bruno Haible <[email-masked]>
Date: Fri, 1 Oct 1999 18:51:27 +0200 (MET DST)

> [71]> (setf sm (regexp:match "^[^:space:]\\+\\b" test))

Change that into

        (setf sm (regexp:match "^[^[:space:]]\\+\\b" test))

and it will do what you expect.

> Again, I'm using the 09-30 snapshot.  Is this all expected behavior?

Yes. This is GNU regexp, after all.

                      Bruno

---

From: Erik Arneson <[email-masked]>
Date: Fri, 1 Oct 1999 10:06:19 -0700 (PDT)

> and it will do what you expect.

Arg!  What a dumb error on my part.

Thanks for pointing this out.

> Yes. This is GNU regexp, after all.

I guess I'll have to do some more careful reading on this.  I made the
mistake of learning regexp in Perl originally.