Getting all URL parameters using regex How about this pattern: (\?|\&)([^=]+)\=([^&]+) Try using this: [^&?]*?=[^&?]*