regex issue

Jay Norwood jayn at prismnet.com
Mon Mar 19 17:56:25 PDT 2012


On Monday, 19 March 2012 at 19:24:30 UTC, Jay Norwood wrote:
> This fails to build, so I'd guess is missing \p
>
> void wcp (string fn)
> {
> 	enum ctr =  ctRegex!("\p{WhiteSpace}","m");
> }
>
> ------ Build started: Project: a7, Configuration: Release Win32
> ------
> Building Release\a7.exe...
> a7.d(210): undefined escape sequence \p
>
> Building Release\a7.exe failed!
> Details saved as "file://G:\d\a7\a7\Release\a7.buildlog.html"
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==========

So I tried something a little different, and this apparently gets 
further along to another error message.  But it looks like at 
this point it decides that the unicode properties are not 
available at compile time...


void wcp_bug_no_p(string fn)
{
	enum ctr =  ctRegex!(r"\p{WhiteSpace}","m");
}


------ Build started: Project: a7, Configuration: Debug Win32 
------
Building Debug\a7.exe...
G:\d\dmd2\windows\bin\..\..\src\phobos\std\regex.d(786): Error: 
static variable unicodeProperties cannot be read at compile time
G:\d\dmd2\windows\bin\..\..\src\phobos\std\regex.d(786):        
called from here: assumeSorted(unicodeProperties)
G:\d\dmd2\windows\bin\..\..\src\phobos\std\regex.d(1937):        
called from here: 
getUnicodeSet(result[0u..k],negated,cast(bool)(this.re_flags & 
cast(RegexOption)2u))





More information about the Digitalmars-d-learn mailing list