you need to double escape \s, since the lisp reader will consume one and cl-ppcre:scan-to-strings will only see s.
On 4/27/06, Daniel Caune daniel.caune@ubisoft.com wrote:
Hi,
I'm facing a strange result while trying to scan a string:
CL-USER> (defconstant +iso-8601-regex+ "([0-9]+)-([0-9]+)-([0-9]+)[\sT]*([0-9]+):([0-9]+):([0-9]+)[+-]([0-9]+)" ) +ISO-8601-REGEX+
CL-USER> (cl-ppcre:scan-to-strings +iso-8601-regex+ "2006-04-13 00:00:00+00") NIL
CL-USER> (cl-ppcre:scan-to-strings +iso-8601-regex+ "2006-04-13T00:00:00+00") "2006-04-13T00:00:00+00" #("2006" "04" "13" "00" "00" "00" "00")
For some reasons, \s seems not to match a whitespace character, unless the space within "2006-04-13 00:00:00+00" is not the space cl-ppcre expects (encoding on Linux?! Hmm... a space is more likely to be encoded with 0x20, isn't it?!).
I tried to match both "2006-04-13 00:00:00+00" and "2006-04-13T00:00:00+00" with the Regex Coach (on Windows), and it works perfectly with that same regex!
Any idea? What can I check?
Regards,
-- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418
cl-ppcre-devel site list cl-ppcre-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-ppcre-devel