How can I match on, but exclude a regex pattern?

You can either use lookbehind (not in Javascript):

(?<=cID=)[^&]*

Or you can use grouping and grab the first group:

cID=([^&]*)

Leave a Comment