strips out all characters except: a-z, A-Z, 0-9, underscore and the forward slash from a String using Python : <p>Using regular expression strips out all characters except a-z, A-Z, 0-9, underscore and the forward slash from a String and All other characters are to get removed and replaced by an underscore. In the replaced version, no consecutive multiple underscores should exist. </p>

<p>For example, </p>

<p>input :- "Ab 4/5        (t) "
output:- "Ab_4/5_t_"</p>

<p>input :- "AB___cd@#   E"
output:- "AB_cd_E"</p>
