I have a string that follows this url pattern as
https://www.examples.org/activity-group/8712/activity/202803
// note : the end ending of the url can be different
https://www.examples.org/activity-group/8712/activity/202803?ref=bla
https://www.examples.org/activity-group/8712/activity/202803/something
I'm trying to write a regex that matches
https://www.examples.org/activity-group/{number}/activity/{number}*
Where {number} is an integer of length 1 to 10.
How to define a regex that checks the string pattern and checks if the number is at the right position in the string ?
Background: in Google form, in order validate an answer , I want to enforce people to enter an url in this format. Hence the use of this regular expression.
For Urls not matching that format, the regex should return false. For example : https://www.notthesite.org/group/8712/activity/astring
I went through several examples, but they match only if the number is present in the string.
Examples sources :