Page 1 of 1

Are the regular expression macros working in NewLisp 10.4.5?

Posted: Tue Dec 11, 2012 5:40 pm
by oofoe
Hi!

Having some trouble with regular expressions... It seems that \d and \D aren't working for me:

Code: Select all

> (find "\d+" "3432" 0) $0
nil
"433"
> (find "\D+" "XC3432" 0) $0
nil
"433"
> (find "[0-9]+" "3432" 0) $0
0
"3432"
I'll limp along with "[0-9]" for now, but it would be nice to know what's going on with the others. According to the PCRE manpage, they should work.

Using newLISP v.10.4.5 on Win32 IPv4/6 libffi from the most recent installer, running on XP64.

Thanks!

Re: Are the regular expression macros working in NewLisp 10.

Posted: Tue Dec 11, 2012 8:11 pm
by cormullion
Try doubling the slashes?

Re: Are the regular expression macros working in NewLisp 10.

Posted: Tue Dec 11, 2012 8:28 pm
by oofoe
cormullion wrote:Try doubling the slashes?
Feetfish! I thought I had tried that and it didn't work!

Code: Select all

> (find "\\d+" "3432" 0) $0
0
"3432"
> (find "\\D+" "XC3432" 0) $0
0
"XC"
But it does work. Thanks Cormullion!