hadoop hadoop

hadoop hadoop

  • NA
  • 159
  • 50.8k

validation of hyphen in the beginning or at the end

Jun 23 2015 4:10 AM
how to validate if hyphen is present in the beginning or at the end? I've done:
<asp:RegularExpressionValidator ID="Regex1" runat="server" ControlToValidate="txtPANnu"
Display="Dynamic" SetFocusOnError="true" ErrorMessage="*Enter Only Alphanumeric characters" ValidationExpression="^[0-9a-zA-Z-]+$">
</asp:RegularExpressionValidator>
this checks only for hyphen but I've to check whether the hypen is present in the beginning or at the end, if so generates error.
so correct inputs are ::
1243-adfsda
fjld-303-ljsdl-3o32
invalid inputs ::
-dfds-322 (present at the beginning)
jlsd-8080- (present at the end)

Answers (1)