I have everything to create bullets from names, but there is one problem. My RegEx replaces spaces with a hyphen. But when the user types "Hi there there" (a few spaces), the slug ends up as "Hi ----- there". When really it should be "Hi there."
Should I create a regular expression so that it replaces only space when there is a character on both sides?
Or is there an easier way to do this?
source
share