Regular Expression Functions

Overview

This Plug-in exposes Java Regular Expression string manipulation capabilities as Appian Functions. Very useful for validation rules and data manipulation on interactive SAIL forms.  

Key Features & Functionality

Datatypes provided:

  • RegexMatch - has a string field representing the string found, a starting index for the string in the haystack and an ending index for the string in the haystack

Regex Flags supported:

  • i - case insensitive
  • g - find all matches
  • m - multiline search
  • s - treats the entire string as a single line
  • u - unicode aware search
  • x - ignores comments starting with '#' and white spaces
  • d - enables unix line mode

Functions provided:

  • regexSearch - Searches for the selected pattern with the specified regex options and returns a list of RegexMatch Datatypes, accepts all regex flags.
  • regexArraySearchIndexOfFirstMatch - Searches an array for a match and returns the first index of match found
  • regexMatch - Indicates whether the regular expression finds a match in the input string, accepts all regex flags.
  • regexInsertMatchMarkers - Finds the match or matches and surrounds them with starting and ending markers, accepts all regex flags.
  • regexFirstMatch - Returns the first match of the regular expression within the input string, accepts all regex flags except 'g'.
  • regexAllMatches - Returns all matches of the regular expression within the input string, accepts all regex flags.
  • regexReplaceAll - Replaces all matches of the regular expression within the input string
Anonymous
Parents
  • Has something happened to "regexIsMatch" in the latest version (2.1.1)?  I just updated from 2.0.1 and now all I can see anymore is the older "regexMatch" function.  It's making me wonder whether the upgrade is working correctly in the environments I'm trying to manage, because what I'm seeing in my Admin Console no longer matches the function list found in the plug-in description here.

  • Hi Mike,

    regexIsMatch was actually a typo introduced in versions 2.0.1/2.0.2 and that combined with the renamed older functions caused backward compatibility issues. As a result those versions were only available from Nov 13-19, 2019, and in 2.1.0 forward the old function names are used but are backward compatible with version 1.0.0. The description looks like it still has that typo, and I'll get that corrected.

  • Yeesh - so just by chance my Prod environment had 2.0.1 and (for whatever reason) the dev team that preceded me didn't sync the versions across environments.  This was throwing me for a major loop earlier today when trying to update since it just seemed like it refused to update at all (as i was expecting "regexIsMatch" to pop up).  Luckily I eventually figured out there's probably a discrepancy.  In general I do support moving back to the older rule naming to preserve backwards compatibility.  Thanks for the feedback.

Comment
  • Yeesh - so just by chance my Prod environment had 2.0.1 and (for whatever reason) the dev team that preceded me didn't sync the versions across environments.  This was throwing me for a major loop earlier today when trying to update since it just seemed like it refused to update at all (as i was expecting "regexIsMatch" to pop up).  Luckily I eventually figured out there's probably a discrepancy.  In general I do support moving back to the older rule naming to preserve backwards compatibility.  Thanks for the feedback.

Children
No Data