Re: Regular Expression Question
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sat, 8 Dec 2007 20:55:34 -0000
=?windows-1252?Q?Arne_Vajh=F8j?= <arne@xxxxxxxxxx> wrote:
Nicholas Paldino [.NET/C# MVP] wrote:
I don't know if it is faster, but it would be much easier to
maintain, from my point of view. Regular Expressions are definitely a
good thing, and worth using, but usually overkill for simple patterns.
One advantage of regex is that if the pattern used may need to be
extended later to more complex ones, then a regex is usually much easier
to extend than IndexOf and Substring.
Hmm, not in my experience. Each time you maintain it, you have to make
sure you fully understand the exact nature of the pattern, and then
carefully change it, ensuring that you escape everything that needs to
be escaped etc.
If you're doing real *pattern* stuff which isn't easily expressed with
Contains/IndexOf etc, then regexes are appropriate - but otherwise I
find the explicit operations easier to understand.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.
- References:
- Regular Expression Question
- From: Nightcrawler
- Re: Regular Expression Question
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Regular Expression Question
- From: Nightcrawler
- Re: Regular Expression Question
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Regular Expression Question
- From: Arne Vajhøj
- Regular Expression Question
- Prev by Date: C# Wrapper into unmanged code
- Next by Date: Re: The exception that is thrown when one of the arguments provided to a method is not valid.
- Previous by thread: Re: Regular Expression Question
- Next by thread: hierarchical TreeView
- Index(es):
Relevant Pages
|