I had a strange problem that I canโt get around ... In principle, I have this Regex that returns material that I donโt have in the capture group, and it does not return the actual captured group. Here is the regex:
"localhost/a/b/c".match(/\/a\/b\/(.*?)/g);
As far as I know, it is supposed to return ["c"]... But it returns:
["/a/b/"]
What am I doing wrong? I thought that the captured groups should have been returned, not ignored.
user3117575
source
share