Re: StringBuilder Extension: IsQuotedBy

Barry Kelly <[email protected]> Thu, 14 Feb 2008 15:01:09 +0000
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Frans Bouma <[email protected]> wrote:

>         So unless you want to write your own NFA based tokenizer/scanner,
> which is fun but also a lot of work, regexp's can greatly help and aren't
> necessarily slower.

Hand-written tokenizers for fixed patterns are trivial to write and are
not a lot of work. Writing a simple tokenizer for a language as complex
as C# should take no more than an hour or so. Also, they're typically
DFAs, as you'd need backtracking for NFA, usually implying recursion - a
typical tokenizer increments monotonically through the source text.

Because of capturing (=> backreferences) etc., I don't believe .NET's
regexs use DFA by default (though they should where possible, because
it's usually a lot faster).

Variable / configurable patterns or throwaway code make a more
substantial use case for regexes.

-- Barry

-- 
http://barrkel.blogspot.com/

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com