0

How to replace all wildcards to "_"

I want to replace "*×+)(Ă·-+%$#@ <>!" Into "_" eg. a = "name* abince k a*" into a = "name__abince_k_a' Please help

26th Nov 2017, 1:50 PM
AbiNce K Asharaf
AbiNce K Asharaf - avatar
1 Answer
+ 3
use regular expression import re a="a*b&c" b=re.sub("[^a-zA-Z0-9]","_",a) print (b)
26th Nov 2017, 4:35 PM
Pavan Kumar T S
Pavan Kumar T S - avatar