I want to grab a specific string only if a certain word is followed by a = sign.
Also, I want to get all the info after that = sign until a / is reached or the string ends.
Let’s take into example:
somestring.bla/test=123/ohboy/item/item=capture
I want to get item=capture but not item alone.
I was thinking about using lookaheads but I’m not sure it this is the way to go. I appreciate any help as I’m trying to grasp more and more about regular expressions.
If you want to capture
item=capture, it is straightforward:If you want to also extract the value,
If you only want to match the value, then you need to use a look-behind.
EDIT: too many errors due to insomnia. Also, screw PHP and its failure to disregard separators in a character group as separators.