Skip to main content
Nintex Community Menu Bar

Regular expression syntax required

  • May 22, 2017
  • 4 replies
  • 12 views

Forum|alt.badge.img+9

I need a syntax that pulls a string that may be up to 10 numbers or could also include characters.

4 replies

Forum|alt.badge.img+9

Hi Michelle Goodman‌,

Can you provide more details what you are trying to do?

Are you trying to limit the number of characters in a string? If so, Try with ^[A-Za-z0-9]{0,10}$ which allows you to limit the number of characters to 10. you can choose small/upper case and numbers.

Try to construct your regular expression in Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript  and use it.

Thanks,

Lakshmi Narayana C


Forum|alt.badge.img+9
  • May 22, 2017

^w{1,10}$

^ asserts position at start of the string
w{1,10}
matches any word character (equal to [a-zA-Z0-9_])
{1,10} Quantifier — Matches between 1 and 10 times, as many times as possible, giving back as needed (greedy)
$ asserts position at the end of the string, or before the line terminator right at

Forum|alt.badge.img+9
  • Author
  • Rookie
  • May 26, 2017

Hi Lakshmi

With ^[A-Za-z0-9]{0,10}$ will this pick up the text if it starts with numbers and then letters?

Thanks


Forum|alt.badge.img+9

Hi Michelle Goodman‌,

Yes it will allow either alphabets(small/upper) or numbers or mix up to 10 characters. If you want try in the Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript site before once.

Thanks,