compile-time regex redux

Chris Miller chris at dprogramming.com
Wed Feb 7 12:25:44 PST 2007


On Wed, 07 Feb 2007 12:04:10 -0500, kenny <funisher at gmail.com> wrote:
> Walter, I don't hate regex -- I just don't use it. It seems to me that  
> to figure out regex syntax takes longer than writing quick for/while  
> statements, and I usually forget cases in regex too...
>
> just being able to write like I can in D with compile time variables  
> would be so much easier for me, and it would only require one template  
> function instead of 35 to parse a simple string... for example.
>
> 1. A while back, I needed something very quickly to remove whitespace.  
> it took me much less time with loops than I ever could have done with a  
> regex. I want to be able to do the same in templates, if possible. I  
> will be trying to reproduce later this, but I think that it will require  
> a lot of templates.

I generally dislike regex for anything semi-complex. It's handy for simple  
things, like it's great as a find/replace feature in an editor, but  
anything more advanced and it's a huge pain.



More information about the Digitalmars-d mailing list