matches - text function

matches()

Overview

The matches() function takes string and regexString (regular expression) as arguments. It compares both the strings and returns True if both are found to be equal. Otherwise, it returns False.

Note: This function performs a case-sensitive comparison.

Return Type

  • Boolean

Syntax

<variable> = <string>.matches(<regexString>);

(OR)

<variable> = matches( <string>, <regexString> );
ParameterDescriptionData type
<variable>Variable which will contain the boolean value, true or false.BOOLEAN
<string>The string to be compared with the regular expressionTEXT
<regexString>The regular expression to be compared with the string.TEXT

Examples

IDValue = "ID004500F";
retValue = matches(IDValue, "[A-Z]{2}[0-9]{6}[A-Z]");     //returns true

num = "$345.78";
ret = matches(num, "\\$[0-9]+\\.[0-9]{2}");                 //returns true

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com