[plt-scheme] Odd behaviour of #px regexps

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Sun Feb 28 10:48:51 EST 2010

Greetings.

Is the following correct?

% mzscheme
Welcome to MzScheme v4.2.4 [3m], Copyright (c) 2004-2010 PLT Scheme Inc.
> (define s "aX ~X")
> (regexp-match #px"^a\\p{L}" s 0)
("aX")
> (regexp-match #px"^~[A-Z]" s 3)
("~X")
> (regexp-match #px"^~\\p{L}" s 3)
#f
> 

I would have expected the last one to return ("~X"), too.  Am I being very dense and forgetting a meaning for "~" in a pregexp?  There's no mention of '~' on the relevant documentation page, so I'm _fairly_ sure it's not a metacharacter.

This is on:

% sw_vers
ProductName:	Mac OS X
ProductVersion:	10.6.2
BuildVersion:	10C540

Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk





Posted on the users mailing list.