Are the regular expression macros working in NewLisp 10.4.5?

Q&A's, tips, howto's
Locked
oofoe
Posts: 61
Joined: Wed Sep 28, 2005 7:13 pm
Contact:

Are the regular expression macros working in NewLisp 10.4.5?

Post 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!
Testing can show the presence of bugs, but not their absence.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

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

Post by cormullion »

Try doubling the slashes?

oofoe
Posts: 61
Joined: Wed Sep 28, 2005 7:13 pm
Contact:

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

Post 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!
Testing can show the presence of bugs, but not their absence.

Locked