Text Validation Regex Help | XM Community
Skip to main content
Solved

Text Validation Regex Help

  • September 14, 2023
  • 1 reply
  • 45 views

Forum|alt.badge.img+1

Hello,

I have a text field that needs the following validation

It should either start with J (and have 5 numeric characters after) or start with P (and have 6 numeric characters after it). However, the following RegEx fails for me, 

 

Could you help me understand how I can get that validation setup?

Best answer by TomG

I think your regex’s should be: ^J\d{5}$ and ^P\d{6}$

View original

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5909 replies
  • Answer
  • September 14, 2023

I think your regex’s should be: ^J\d{5}$ and ^P\d{6}$


Leave a Reply