unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Guile regular expressions are too greedy
@ 2009-07-22 10:05 Chris Dennis
  2009-07-22 12:21 ` Ludovic Courtès
  2009-07-22 13:41 ` Peter Brett
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Dennis @ 2009-07-22 10:05 UTC (permalink / raw)
  To: guile-user

Hello Guile People

Is there a way to make Guile regular expressions less greedy?  I 
understand that POSIX doesn't define non-greedy modifiers.

Specifically, I'm trying to parse font names such as

     Arial 12
     Arial Bold Italic 14
     Nimbus Sans L Bold Italic Condensed 11

so that I can construct CSS styles from them.

I've tried the following, but the first (.*) gobbles up everything 
before the size because the other elements are optional:

(define s (string-match "(.*)( +(bold|semi-bold|regular|light))?( 
+(italic|oblique))?( +(condensed))? +([0-9]+)" "nimbus sans l bold 
italic condensed 11"))


Are there other ways of doing this?

cheers

Chris
-- 
Chris Dennis                                  cgdennis@btinternet.com
Fordingbridge, Hampshire, UK




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-22 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 10:05 Guile regular expressions are too greedy Chris Dennis
2009-07-22 12:21 ` Ludovic Courtès
2009-07-22 13:12   ` Chris Dennis
2009-07-22 13:32     ` Ludovic Courtès
2009-07-22 13:41 ` Peter Brett
2009-07-22 15:47   ` Guile regular expressions are too greedy [Solved] Chris Dennis

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).