Idea ID: 2822047

SMAX: Text function for regular expression

Status : Waiting for Votes
Waiting for Votes
See status update history
9 months ago

There is a text function match_pattern which can be used with the wildcards ? and *. But you will fail with this function, if you want to check whether a given string matches a defined pattern.

Currently I have strings like sssss-ddddd, where s is any letter and d any digit.

Tags:

  • We strongly need this feature in SMAX for validating the user input as below examples:

    RegEx:

    IP Addresses: ^((\, ){0,1}(([0-9]|x){1,3}\.){3}([0-9]|x){1,3}(\/[0-9]{1,2}){0,1})+

    Ports: ^((, ){0,1}([0-9]{2,5})(\-[0-9]{2,5}){0,1})+$

    Text:

    IP Address: 1.2.3.4, 1.2.3.xxx, 1.2.3.4/56

    Ports: 12, 12-34

    The above can be done in SM, but not in SMAX.

  • An idea that I do support wholeheartedly.

    Whatever the development framework being used at the basis of SMAX, it is 100% sure that it includes a robust regular expression matching library.

    Why not expose that via a new match_regex() function.

    Ideally also combined with a replace_regex(<input-string>, <pattern>, <substitution-string>) similar to the JavaScript replace function.

    Can't be a terribly high development effort, but would be of tremendous value in many business rules.

  • Thank you for sharing your idea! It’s open for comments and kudos, and we’re looking forward to input from the community. Once there is enough community traction, it will be further reviewed by the product team.

  • An additional use case for regular expression is to check whether a string is a valid email address or phone number.