unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Cc: bug-guile@gnu.org, guile-user@gnu.org
Subject: Re: regexp-exec fails for long strings
Date: Thu, 25 Apr 2002 23:47:13 +0200	[thread overview]
Message-ID: <20020425214713.GA19857@www> (raw)
In-Reply-To: <E170pV0-00018q-00@giblet>

On Thu, Apr 25, 2002 at 01:05:50PM -0700, Thien-Thi Nguyen wrote:
>[...] 
> 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.)

Ok, this is on my rather 'old' guile-1.5 box (the guile-HEAD is at home):

|  guile> (version)
|  "1.5.0"
|  guile> (use-modules (ice-9 regex))
|  guile> 
|  guile> (define ok "<section_name>Projects List</section_name>")
|  guile> 
|  guile> (define rx (make-regexp "<section_name>(.*)</section_name>"))
|  guile> 
|  guile> (define (+space s n)
|  ...   (string-append s (make-string n #\space)))
|  guile> 
|  guile> (define (test s)
|  ...   (format #t "string-length ~A\t=> ~A\n"
|  ...           (string-length s)
|  ...           (if (regexp-exec rx s)
|  ...               "ok"
|  ...               "FAIL")))
|  guile> (test ok)
|  string-length 42	=> ok
|  guile> (test (+space ok 11672))
|  string-length 11714	=> ok
|  guile> (test (+space ok 11673))
|  string-length 11715	=> ok
|  guile> (test (+space ok 11674))
|  string-length 11716	=> FAIL
|  guile> (test (+space ok 11675))
|  string-length 11717	=> FAIL
|  guile> (test (+space ok 11700))
|  string-length 11742	=> FAIL
|  guile> 
|  

Hmmm, never really used guile's regex heavily - that's where i
still use <blush>perl</blush>.

  Ralf

> 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
> 
> _______________________________________________
> Guile-user mailing list
> Guile-user@gnu.org
> http://mail.gnu.org/mailman/listinfo/guile-user

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


  reply	other threads:[~2002-04-25 21:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-25 20:05 regexp-exec fails for long strings Thien-Thi Nguyen
2002-04-25 21:47 ` rm [this message]
2002-04-25 23:29   ` Thien-Thi Nguyen
2002-05-15  3:53     ` Thien-Thi Nguyen
2002-05-15  6:04       ` Wolfgang Jährling
2002-05-15  8:19         ` Thien-Thi Nguyen
2002-04-26  4:32   ` Tom Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020425214713.GA19857@www \
    --to=rm@fabula.de \
    --cc=bug-guile@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).