guile-user
[Top][All Lists]
Advanced

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

regexp-exec fails for long strings


From: Thien-Thi Nguyen
Subject: regexp-exec fails for long strings
Date: Thu, 25 Apr 2002 13:05:50 -0700

well, good and bad news.

the good news is that another guile project was recently added to the
projects list.  the bad news is that for www.gnu.org, template.scm now
fails due to unfulfilled regexp matching.  (this has resulted in an
empty project page there.)  below is a test case that demonstrates the
problem.  running "pre-inst-guile -s" on it shows three "ok" and three
"FAIL" for both HEAD and branch_release-1-6.

if someone can confirm similar behavior on another system (perhaps by
varying the appended string length), i will add this to the bugs db.
(i ask for this confirmation because my system's old sdrams are prone to
mysterious failures, and i want to rule that out as a reason.)

thi

____________________________________________
(use-modules (ice-9 regex))

(define ok "<section_name>Projects List</section_name>")

(define rx (make-regexp "<section_name>(.*)</section_name>"))

(define (+space s n)
  (string-append s (make-string n #\space)))

(define (test s)
  (format #t "string-length ~A\t=> ~A\n"
          (string-length s)
          (if (regexp-exec rx s)
              "ok"
              "FAIL")))

;; do it
(test ok)                               ; ok
(test (+space ok 11672))                ; ok
(test (+space ok 11673))                ; ok
(test (+space ok 11674))                ; FAIL
(test (+space ok 11675))                ; FAIL
(test (+space ok 11700))                ; FAIL



reply via email to

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