0

I'm trying to extract a value from inside a URL which follows this sort of pattern: my/url/{value}/test. I'm currently unable to extract the {value} only and nothing after {value}.

Here are some sample input: my/url/1Q23RTFKFK/test my/url/RR43UHIR4U/test/qwerty

With the following regex (?<=url/)(.*)(?=/), I get the following result: 1Q23RTFKFK RR43UHIR4U/test

I would like to get only the {value} from the URL: 1Q23RTFKFK RR43UHIR4U

What am I doing wrong with my regex? Thanks.

Redson
  • 2,098
  • 4
  • 25
  • 50

0 Answers0