I’m trying to create a regular expression that can contain some of those three elements 0…X times :
/cat1/var1
/cat2/var2
/cat3/var3
This is what I got so far :
((cat1|cat2|cat3)/(?P<var>\w+))*
In this sample string it’s only matching the first occurrence : http://url.dev/cat1/aaaaa/cat1/bbbbb/cat2/ccccc
In this sample there is also two occurrences of cat1, I would like to know if its possible to harvest the two values.
A few samples of what I want to match :
http://url.dev/cat1/aaaaa/cat1/bbbbb/cat2/ccccc/cat3/ddddd/cat3/eeeee
could you just use
It will match all cat/var occurences
[EDIT]
so was :