regex url parser


/ Published in: Regular Expression
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.