Find by Regular Expression

Verb: isMatch

Searches in a text for the first match of the regular expression, returning true or false if the specified regular expression is contained in the text.

Syntax

isMatch --text(String) --regexPattern(String) [--regexOptions(DisplayableRegexOptions)] (Boolean)=value

Inputs

Script Designer Required AcceptedTypes Description
--text Text Required Text Text in which the Regular Expression is searched for.
--regexPattern Regular expression Required Text Regular Expression that should be searched in Text.
--regexOptions Options Optional DisplayableRegexOptions Filtering options that assist in regular expression search:
  • Compiled
  • Culture Invariant
  • ECMA Script
  • Explicit Capture
  • Ignore Case
  • Ignore Pattern Whitespace
  • Multiline
  • Right To Left
  • Singleline
  • --regex Regular expression(Obsolete) Optional Text Regular expression defined to find occurrences in the text.
    This parameter is obsolete, use the Regular expression parameter instead.
    --ignorecase Ignore case(Obsolete) Optional Boolean When enabled, specifies case-insensitive matching.
    This parameter is obsolete. To select regular expression options, use the Options instead.
    --dotmatchesnewline Dot matches new line(Obsolete) Optional Boolean When enabled, the dot (.) character matches every character, instead of every character except "\n".
    This parameter is obsolete. To select regular expression options, use the Options instead.
    --freespacing Ignore white space(Obsolete) Optional Boolean When enabled, eliminates blank spaces and breaks without adding a escape character.
    This parameter is obsolete. To select regular expression options, use the Options instead.
    --explicitcapture Explicit capture(Obsolete) Optional Boolean When enabled, specifies that the only valid captures are explicitly named or numbered groups of the form (? ).
    This parameter is obsolete. To select regular expression options, use the Options instead.
    --multiline Multiline(Obsolete) Optional Boolean When enabled, changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.
    This parameter is obsolete. To select regular expression options, use the Options instead.

    Outputs

    Script Designer AcceptedTypes Description
    value Ocurrence Boolean Returns "True" if the regular expression defined in the parameter occurs Regular Expression or "False" otherwise.

    Example

    Searches for the element corresponding to the regular expression "\d\d\d\d\d-\d\d\d" in the text "IBM Robotic Process Automation Rio Preto zip code: 15055-480".

    defVar --name text --type String --value "IBM Robotic Process Automation Rio Preto zip code : 15055-480"
    defVar --name regularExpression --type String --value "\\d\\d\\d\\d\\d-\\d\\d\\d"
    defVar --name ocurrence --type Boolean
    // Search for first occurrence of regular expression "\\d\\d\\d\\d\\d-\\d\\d\\d" in the text.
    isMatch --text "${text}" --regexPattern "${regularExpression}" --regexOptions "RightToLeft" ocurrence=value
    logMessage --message "Regular expression match: ${ocurrence}" --type "Info"
    // This example produces the following result:
    // Regular expression match: True.
    

    Remarks

    Many options may be selected in the Options parameter.