Posted By

darronz on 08/31/10


Tagged

url


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


regex url parser


 / Published in: Regular Expression
 

  1. /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)(:([^\/]*))?((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(\?([^#]*))?(#(.*))?$/gi
  2.  
  3. schema = 2,
  4. domain = 3,
  5. port = 5,
  6. path = 6,
  7. file = 8,
  8. querystring = 9,
  9. hash = 12

Report this snippet  

You need to login to post a comment.