[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Why no PCRE for Windows?
From: |
Chess Player |
Subject: |
Re: [Chicken-users] Why no PCRE for Windows? |
Date: |
Fri, 7 Jul 2006 17:46:27 -0700 (PDT) |
--- 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).
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