Thursday 6 July 2017

String to Validate only alphabets [Regular Expression is AX ]

Following is an Example of Regular Expressions :

static void TextBuffer_regularExpression(Args _args)
{
    TextBuffer txt = new TextBuffer();
    str msg = "ABCDXYZ";

    txt.setText(msg);
    txt.regularExpressions(true);   // activate regular expr in search

     // Regular expression to validate only digits
     if (txt.find("^[A-Z]+$"))
    {
        info("string contains only alphabets");
    }
}

No comments:

Post a Comment