I have a list of the following strings:
/fajwe/conv_1/routing/apwfe/afjwepfj
/fajwe/conv_2/routing/apwfe
/fajwe/conv_2/routing
/fajwe/conv_3/routing/apwfe/afjwepfj/awef
/fajwe/conv_4/routing/apwfe/afjwepfj/awef/0o09
I want a regex to only match string contains no more than 1 /
after the word routing
. Namely /fajwe/conv_2/routing/apwfe
and /fajwe/conv_2/routing
.
Currently I use the regex ^((?!rou\w+(\/\w+){2,}).)*$
but it matches nothing. How can I write a regex to exclude strings contains more than 2 /
after the word routing
?
I would love to learn how to achieve this using Negative Lookbehind. Many thanks!