dimanche 6 septembre 2015

Regex - how to avoid matching a pattern if its inside a URL

Trying to get all variables that starts with % and followed by a single digit

eg: %1

I'm currently using %[0-9] or %\d

But in the content which I'm searching there are some URL having those variables

eg: http://ift.tt/1NkGfOg

http://ift.tt/1LejG7T

Would they be a pattern where I could search all the %\d patterns except in a URL form string?

Aucun commentaire:

Enregistrer un commentaire