Regex lookahead
问题 I am using a regex to find: test:? Followed by any character until it hits the next: test:? Now when I run this regex I made: ((?:test:\?)(.*)(?!test:\?)) On this text: test:?foo2=bar2&baz2=foo2test:?foo=bar&baz=footest:?foo2=bar2&baz2=foo2 I expected to get: test:?foo2=bar2&baz2=foo2 test:?foo=bar&baz=foo test:?foo2=bar2&baz2=foo2 But instead it matches everything. Does anyone with more regex experience know where I have gone wrong? I've used regexes for pattern matching before but this is