-2

I would like to create a regexp for these occurences:

works for:

*menupoint/example 

and not accept this:

*menupoint/example/example

so after the menupoint teher will be maximum one /. I tried this one but not working:

%menupoint\/[^\/]+

Thanks for the helps!

NNN
  • 3
  • 2

2 Answers2

1

How about use "$" sign to match the end of the string, it will make sure the "/" after "menupoint" is the last "/" in your target string.

menupoint\/[^\/]+$

Demo: https://regex101.com/r/WrALCc/1

jrying
  • 59
  • 4
0

Try to replace % whith .*:

.*menupoint\/[^\/]+
Pavlo Plynko
  • 586
  • 9
  • 27