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

Regex - Validation Help :)

  • Jan 23, 2024 3:07 PM UTC
  • 5 replies
  • 127 views

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+48
  • Jan 23, 2024 6:40 PM UTC

@parkie_0007 

Try this
 

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

 


Forum|alt.badge.img+5
  • Author
  • Level 5 ●●●●●
  • Jan 23, 2024 7:20 PM UTC

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 ●●●●●
  • Jan 23, 2024 7:41 PM UTC

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+48
  • Answer
  • Jan 23, 2024 9:11 PM UTC

@parkie_0007 

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


Forum|alt.badge.img+5
  • Author
  • Level 5 ●●●●●
  • Jan 24, 2024 4:13 AM UTC

Legend, thanks!