Regex - Validation Help :) | XM Community
Solved

Regex - Validation Help :)

  • 23 January 2024
  • 5 replies
  • 44 views

Userlevel 6
Badge +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 :)

icon

Best answer by Deepak 23 January 2024, 22:11

View original

5 replies

Userlevel 7
Badge +36

@parkie_0007 

Try this
 

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

 

Userlevel 6
Badge +5

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!

Userlevel 6
Badge +5

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

I could not get the above link to pass.

Thanks @Deepak 

Userlevel 7
Badge +36

@parkie_0007 

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

Userlevel 6
Badge +5

Legend, thanks! 

Leave a Reply