2
In this sentence, /comprar/volkswagen/gol/11184529
, I’d like to capture if the word exists comprar
what comes next without the /
, I would like to capture the word volkswagen
(but it could be another brand(it would have to be generic, because I won’t guess which brand)) and gol
(but it could be another model(it would have to be generic, because I won’t guess which brand))
Regex
^\/comprar\/([^\/]+)\/([^\/]+)\/\d+$
. Dai takes the first and second groups.– Marcelo Shiniti Uchimura