So I have this string: (a url)
example.html/#playYouTubeVideo=id[lBs8jPDPveg]&width[160]&height[90]
I want to match id, width and height. And the value in [ ]
I came up with this:
[=|&](\w+)(?!\[)(.+?)(?=\])
But the match for group #1: i, widt and heigh
And the match for group #2: d[lBs8jPDPveg, h[160 and t[90
So the error is that the last letter in the name and [ is in group #2
Anyone got an idea how to fix it?
Why don’t you do:
Group 1 will have id, width, height, group 2 will have what’s in the
[].(Do you actually want the
|in that preceding bit?)