www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - using regex at compiletime

reply "gedaiu" <szabobogdan yahoo.com> writes:
Hi,

I am trying to use regex at compile time for pasing of some html 
files. The code works perfect at runtime but at compile time i 
get this error:



/usr/include/dmd/phobos/std/regex.d(5824): Error: malloc cannot 
be interpreted at compile time, because it has no available 
source code
/usr/include/dmd/phobos/std/regex.d(5824):        called from 
here: enforce(malloc(size), delegate const(char)[]() => null, 
"/usr/include/dmd/phobos/std/regex.d", 5824LU)
/usr/include/dmd/phobos/std/regex.d(5961):        called from 
here: matchOnce(input, re)
source/cthtml.d(121):        called from here: matchFirst(text, 
rTag)
source/cthtml.d(397):        called from here: 
structure.this(content, "", "ROOT")


It is not possible to use regex at compiletime and I should use 
palain text matching?

Thanks,
Bogdan
Jun 15 2014
parent "Dicebot" <public dicebot.lv> writes:
AFAIK you can _generate_ regex at compile-time but not actually 
use it.
Jun 15 2014