Skip to main content
hema.mathivathanan
July 21, 2023
Solved

Regex

  • July 21, 2023
  • 7 replies
  • 1 view

Hi, 

I want to use regex function to check if the entered value is a text ( both upper and lower case check) and if it's more than 12 characters.
^[a-zA-Z]{1-12}$" .I used like this. can someone guide here. 

    Best answer by stefanhelzle0001

    This is confusing. Why do you check whether the string does NOT match the pattern. I mean, to make sure a string is digits only and max 12 characters, you can use this:

    if(
      regexmatch(
        "^[0-9]{1,12}$",
        ri!value,
      ),
      null,
      "The account must be numerical and no more than 12 numbers"
    )

    7 replies

    stefanhelzle0001
    July 21, 2023

    ^[A-Za-z]{12,}$

    hema.mathivathanan
    July 21, 2023

    I used this in Validation for my field, but it's not validating. 
    if(
    regexmatch(
    "^[A-Za-z]{12}$",
    ri!frecord[],

    ),

    "The account must be numerical and no more than 12 numbers",
    {}
    )

    stefanhelzle0001
    July 21, 2023

    I am missing that comma here