You can use regular expression validator.
<asp:TextBox ID="txtStringFirstLast" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
ControlToValidate="txtStringFirstLast" ErrorMessage="first and last letter must be digit."
ValidationExpression="^\d\w*\d$" ></asp:RegularExpressionValidator>
You can download regular expression builder here to create any regular expression and test it:
[
http://sourceforge.net/projects/regexbuilder/files/]