Python Regex: Replace Non Character

July 31, 2019
import re

v = re.sub(r"[^\w]", "_", "hello-world123.txt") # hello_world123_txt
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.