Need help with filtering text in a texbox
i have been head scratching on over hour, trying allow following text in textbox
a- z -z 0 - 9 , ^
trying keep showing message box illegal characters
system.text.regularexpressions.regex regex = null;
regex = new system.text.regularexpressions.regex("^([a-za-z0-9-^])*$");
if (regex.ismatch(textbox1.text)) {
}
else
{
xtramessagebox.show("there seems issue not allowed illegal characters", "error", messageboxbuttons.ok, messageboxicon.error);
}
can seeing doing wrong ? guys.
a- z -z 0 - 9 , ^
trying keep showing message box illegal characters
system.text.regularexpressions.regex regex = null;
regex = new system.text.regularexpressions.regex("^([a-za-z0-9-^])*$");
if (regex.ismatch(textbox1.text)) {
}
else
{
xtramessagebox.show("there seems issue not allowed illegal characters", "error", messageboxbuttons.ok, messageboxicon.error);
}
can seeing doing wrong ? guys.
try expression:
@"^([a-za-z0-9\^])*$"
and show example of text gives problem.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment