A
Anders Borum
Hello!
I have a class that needs to validate the input value, when a programmer
changes a specific property on a class. The input should only accept the
following pattern [a-zA-Z0-9]{1,n} (alpha-numeric with atleast one entry).
I'm a little resistant to implementing a regular expression validation,
because of the overhead involved (not because I can't
. Obviously, it's
possible to implement the pattern validation using regular string ops ..
What should I choose? I imagine the access frequency is rather low, but I
don't want to go the wrong direction - also in terms of future API
development.
// Class definition omitted for brevity..
/// <summary>
/// Gets or sets the Area name. The Area name must be a fully
/// qualified ASP.NET control id in the form of [a-zA-Z0-9].
/// </summary>
public string AreaName
{
get { return this.areaName; }
set
{
// include validation here ..
// RegEx or string-ops?
this.areaName = value;
}
}
Thanks in advance!
I have a class that needs to validate the input value, when a programmer
changes a specific property on a class. The input should only accept the
following pattern [a-zA-Z0-9]{1,n} (alpha-numeric with atleast one entry).
I'm a little resistant to implementing a regular expression validation,
because of the overhead involved (not because I can't

possible to implement the pattern validation using regular string ops ..
What should I choose? I imagine the access frequency is rather low, but I
don't want to go the wrong direction - also in terms of future API
development.
// Class definition omitted for brevity..
/// <summary>
/// Gets or sets the Area name. The Area name must be a fully
/// qualified ASP.NET control id in the form of [a-zA-Z0-9].
/// </summary>
public string AreaName
{
get { return this.areaName; }
set
{
// include validation here ..
// RegEx or string-ops?
this.areaName = value;
}
}
Thanks in advance!