How to use the regular expression to validate the number string
static void TextBuffer_RegularExpression(Args _args)
{
TextBuffer txt = new TextBuffer();
str msg = "9876543210";
txt.setText(msg);
// activate regular expr in search
txt.regularExpressions(true);
// Regular expression to validate only digits
if (txt.find("^[0-9]+$"))
{
info("string contains only numbers");
}
else
{
info("string contains Alphanumeric characters.");
}
}
Happy DAXing...... :)
No comments:
Post a Comment