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:
Regex Flags supported:
Functions provided:
Good day! Just starting to learn your product, but how can I get this Java REGEX into your regex function to return a result?
List<String> ssns = new ArrayList<String>(); //Valid SSNs ssns.add("123-45-6789"); ssns.add("856-45-6789"); //Invalid SSNs ssns.add("000-45-6789"); ssns.add("666-45-6789"); ssns.add("901-45-6789"); ssns.add("85-345-6789"); ssns.add("856-453-6789"); ssns.add("856-45-67891"); ssns.add("856-456789"); String regex = "^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$"; Pattern pattern = Pattern.compile(regex); for (String number : ssns) { Matcher matcher = pattern.matcher(number); System.out.println(matcher.matches()); } Output: true true false false false false false false false
Hello! For that you should use regexmatch. Just put the pattern in the first argument and the string you want to check in the second argument. To duplicate that more closely just loop through the list.
Hello!
For this you'd probably just want to use the regexmatch function like this:
a!localVariables( local!ssns: { /*Valid SSNs*/ "123-45-6789", "856-45-6789", /*Invalid SSNs*/ "000-45-6789", "666-45-6789", "901-45-6789", "85-345-6789", "856-453-6789", "856-45-67891", "856-456789" }, a!forEach( items: local!ssns, expression: regexmatch( "^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$", fv!item ) ) ) Output: true(Boolean) true(Boolean) false(Boolean) false(Boolean) false(Boolean) false(Boolean) false(Boolean) false(Boolean) false(Boolean)