Welcome, guest | Sign In | My Account | Store | Cart
_slugify_strip_re = /[^\w\s-]/g;
_slugify_hyphenate_re = /[-\s]+/g;
function slugify(s) {
  s = s.replace(_slugify_strip_re, '').trim().toLowerCase();
  s = s.replace(_slugify_hyphenate_re, '-');
  return s;
}

Diff to Previous Revision

--- revision 1 2011-07-12 17:41:07
+++ revision 2 2011-07-12 17:46:49
@@ -1,4 +1,4 @@
-_slugify_strip_re = /[^\w\s-]/;
+_slugify_strip_re = /[^\w\s-]/g;
 _slugify_hyphenate_re = /[-\s]+/g;
 function slugify(s) {
   s = s.replace(_slugify_strip_re, '').trim().toLowerCase();

History