Posted By

Abderrahmane_TJ on 09/30/11


Tagged

url regexp slug


Versions (?)

Sluggify


 / Published in: JavaScript
 

  1. function slugify() {
  2. text = this;
  3. text = text.replace(/[^-a-zA-Z0-9\s+]+/ig, '');
  4. text = text.replace(/\s+/gi, "-");
  5. return text;
  6. }

Report this snippet  

You need to login to post a comment.