I have a string that kind of looks like this:
\"stuff . // : /// more-stuff .. .. ...$%$% stuff -> DD\"
and I want to strip off all p
Here's a single-step approach (but the uppercasing actually uses a string method -- much simpler!):
rex = re.compile(r'\W+') result = rex.sub(' ', strarg).upper()
where strarg is the string argument (don't use names that shadow builtins or standard library modules, please).
strarg