I want to match a url like "index.html\index_1.html\index_12.html\index_49.html\index_n.html and the n must <50 not be 50
Asked
Active
Viewed 36 times
3 Answers
0
You can achieve this by using - index_[1-4]?\d\.html as your regex.
What this does is it first limits the first digit of two to the numbers 1-4 then accepts any other following digit. The ? makes it so that the digit may be skipped if it cannot be found
regex101 link - https://regex101.com/r/BwMCdu/1 which has a few examples
Karan Shishoo
- 2,217
- 2
- 16
- 30
0
Try the following:
(((index)|(index_[0-9])|(index_[0-4][0-9])).html)
Md Golam Rahman Tushar
- 1,847
- 1
- 9
- 25
0
You can use [1-4]?[0-9]
index.html\index_1.html\index_12.html\index_49.html\index_[0-4]?[0-9].html$
VinnieS
- 73
- 11