'Match multiple urls combination with regex
I have a set of urls with the following structure:
https://www.test.com/us/page1
https://www.test.com/us/page2
https://www.test.com/eu/page1
https://www.test.com/eu/page2
https://www.test.com/fr/page1
https://www.test.com/fr/page2
I'm doing as following for the regex:
https:/\/\www.test.com/\(us)|(eu)|(fr)|/\(page1)|(page2)
But it seems not matching those cases. Can anyone explain me what I'm doing wrong with a workable example?
Solution 1:[1]
How about:
Note that in your question you have the escapes backwards:
https:/\/\
Should actually be:
https:\/\/ (if you need to escape it, many regex flavors don't have to escape /)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | David542 |

