Questions about builtin RegExp

Regan Heath regan at netwin.co.nz
Sun Feb 19 19:27:22 PST 2006


On Sun, 19 Feb 2006 18:52:19 -0800, Walter Bright  
<newshound at digitalmars.com> wrote:
> "Regan Heath" <regan at netwin.co.nz> wrote in message
> news:ops48ur1em23k2f5 at nrage.netwin.co.nz...
>> Here's how I'd do it:
>
> Your's is a lot of code to do what a regex does.

This is true, though my code is likely faster.

> Now recognize a url <g>.

Nah. You've made your point.. in fact I was secretly trying to help. <g>

Regex is a good general purpose string parsing facility. I personally find  
composing a regex can be complicated, likely it's easier with practice. A  
custom piece of code is probably faster and I find it easier to tweak. In  
the end, unless it was performance critical or has resisted my initial  
efforts at composing a regex, I'd probably use a regex.

Regan



More information about the Digitalmars-d mailing list