Re: Only allowing alphanumeric characters and '_' and '-'
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Wed, 27 Feb 2008 21:53:27 -0500
KH wrote:
I usually avoid regex's because of performance. In this case I haven't tested but would imagine the difference is approximatly "who cares" ... nonetheless I just think of regex's as overkill in many situations where people try to use them.
Usually fewer lines of code is what is most cost effective overall.
Regex is simple code (and if the reader knows regex as a general concept
it is even easy to read) and code that is easy to modify to different
requirements.
It does come with a certain overhead. It may not be suited for
being called billions or trillions of times. But I doubt that was
the case here (the variable was named 'username').
Arne
.
- References:
- Only allowing alphanumeric characters and '_' and '-'
- From: DotNetNewbie
- Re: Only allowing alphanumeric characters and '_' and '-'
- From: Arne Vajhøj
- Only allowing alphanumeric characters and '_' and '-'
- Prev by Date: Re: How to get events assigned to ToolStripMenuItem.Click
- Next by Date: Re: Automation Excel 2003
- Previous by thread: Re: Only allowing alphanumeric characters and '_' and '-'
- Next by thread: RE: Only allowing alphanumeric characters and '_' and '-'
- Index(es):
Relevant Pages
|