Regex - Validation Help :) | XM Community
Skip to main content
Solved

Regex - Validation Help :)


Forum|alt.badge.img+5

Hello

Hope everyone is well. 👊

I need help with code for a regex validation.

I have a text entry field, that can only pass if the end of a URL is.

/########

The above is forward slash then 8 digits, like this example.

Thanks everyone :)

Best answer by Deepak

@parkie_0007 

Try this
/^https:\/\/.+\/\d{8}$/

View original

5 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+44
  • 1549 replies
  • January 23, 2024

@parkie_0007 

Try this
 

/^https:\/\/[^\/]+\/\d{8}$/

 


Forum|alt.badge.img+5
  • Author
  • Level 5 ●●●●●
  • 151 replies
  • January 23, 2024

Thanks @Deepak 

Although I am yet to test this, would it make any difference to the code now that you can see the full URL, or is this code always just for / 8 digits at the end?

Thanks!


Forum|alt.badge.img+5
  • Author
  • Level 5 ●●●●●
  • 151 replies
  • January 23, 2024

I just tested that, but unfortunately it did not work.

I could not get the above link to pass.

Thanks @Deepak 


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+44
  • 1549 replies
  • Answer
  • January 23, 2024

@parkie_0007 

Try this
/^https:\/\/.+\/\d{8}$/


Forum|alt.badge.img+5
  • Author
  • Level 5 ●●●●●
  • 151 replies
  • January 24, 2024

Legend, thanks! 


Leave a Reply