Select to view content in your preferred language

Arcade: Regular Expression Support

2029
4
06-05-2022 02:19 PM
Status: Open
Labels (1)
JustinReynolds
Frequent Contributor

Add support for Regex in Arcade.  This will help with text validation both server and client side.

4 Comments
DaveSivertsenz

Usecase: Limit ID field entry to [0-9,A-Z]. Currently, have to create whitelist array length 36, and forloop find every character in user entry. Sprawling, ugly and slow.

JoshuaBixby

I agree this is a big shortcoming of Arcade.  I am hard pressed to think of another scripting language that doesn't support, at least partially, regular expressions. 

DavidFriedrich

Absolutely needed to validate free-form input text against a list of patterns

AlfredBaldenweck

This would be super helpful. The alternatives are to either painstakingly evaluate the input OR, if this suits the workflow and you have the license for it, use a validation rule with the Data Reviewer extension. See here for a relevant discussion: Solved: Re: Constraint or validation rule to check that te... - Esri Community

 

Just evaluating a regex for use in constraint rules would be great, or to extract particular substrings from input text (classic example would be an email or a phone number).