chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Why no PCRE for Windows?


From: Kon Lovett
Subject: Re: [Chicken-users] Why no PCRE for Windows?
Date: Sun, 9 Jul 2006 10:16:46 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jul 7, 2006, at 5:46 PM, Chess Player wrote:



--- felix winkelmann <address@hidden> wrote:


The newLISP executable for windows includes the PCRE engine
and is only 180,736 bytes in size.

Hm. PCRE is even BSD licensed, but I'm a bit reluctant to add third
party software to the distribution.


#;4> (string-search "foo.*bar" "foo\nbar")
#f
#;5> (string-search "foo.*bar" "foo-bar")
("foo-bar")

The dot doesn't match a newline.  Using either regular-expression
engine, how does one change that?

I can look into that next week, when I'm sitting in front of a linux
box again, ok? Generally it will mean using optional arguments for
the "regexp" function (for pcre, I dunno about pregexp, yet).

My reading of "pcre.scm" says that arbitrary PCRE flags cannot be passed to 'regexp'.


In newLisp:

newLISP v.8.9.0 on Win32 MinGW, execute 'newlisp -h' for more info.

(regex {foo.*bar} "foo\nbar")
nil
(regex {foo.*bar} "foo\nbar" 4)
("foo\nbar" 0 7)

The available options for PCRE are:

  PCRE_CASELESS        1 ; treat uppercase like lowercase
  PCRE_MULTILINE       2 ; limit search at a newline like Perl's /m
  PCRE_DOTALL          4 ; . (dot) also matches newline
  PCRE_EXTENDED        8 ; ignore whitespace except inside char class
  PCRE_ANCHORED       16 ; anchor at the start
PCRE_DOLLAR_ENDONLY 32 ; $ matches at end of string, not before newline
  PCRE_EXTRA          64 ; additional functionality currently not used
PCRE_NOTBOL 128 ; first char not start of line, ^ shouldn't match PCRE_NOTEOL 256 ; last char not end of line, $ shouldn't match
  PCRE_UNGREEDY      512 ; invert greediness of quantifiers
  PCRE_NOTEMPTY     1024 ; empty string considered invalid
  PCRE_UTF8         2048 ; pattern and strings as UTF-8 characters

Unfortunately, these constants aren't defined by newLisp, so you have
to look them up or define them yourself.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iEYEARECAAYFAkSxOf4ACgkQJJNoeGe+5O7dMACfUJc8YmbdqclqpiISR+RAj335
BGYAnROAQwpces68i2HLQb2/hC9THoKM
=2OA+
-----END PGP SIGNATURE-----




reply via email to

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