9 lines
159 B
Python
9 lines
159 B
Python
import re
|
|
|
|
|
|
SLUGIFY_PATTERN = re.compile(r"[^a-zA-Z0-9-]")
|
|
|
|
|
|
def slugify(text: str) -> str:
|
|
return SLUGIFY_PATTERN.sub("", text.lower().replace(" ", "-"))
|