mardi 4 août 2015

Check if FORMAT is valid based on a pattern list

Using URLs.. I have a list of acceptable url formats, like this:

  1. domain.com/test
  2. domain.com/test/
  3. http://ift.tt/1ImnCm4
  4. http://ift.tt/1KNGNLw

User input this http://ift.tt/1ImnB1C will return True based on my #3 entry at url format list..

The user input something like http://ift.tt/1KNGNLy return false.. domain.com/ return false, because does not match with any entry of my format list.

whats the best way to do this?

edit: im not trying to check if url is valid! i'm trying to check if FORMAT is valid based on my pattern list..

Aucun commentaire:

Enregistrer un commentaire