我想要一个正则表达式来排除字符串开头和结尾的特殊字符
我试过这段代码,但它不工作
String strFileName = Regex.Replace(FileName, @"[^A-Za-z0-9-_ ]", "");
<asp:RegularExpressionValidator ID = "Regular"
ValidationGroup = "valGroup" runat="server" ControlToValidate = "txtreport"
ErrorMessage = "Please enter valid data."
ValidationExpression = "([a-z]|[A-Z]|[0-9])*">
</asp:RegularExpressionValidator>