If Python contains even one of the Windows file name unknown characters \:/ * ? " < > | I want to replace those characters with spaces.
I don't know how to write a regular expression to include everything.
Please answer
You can just put in the characters you want to replace by |.
before_str = "a?a:aa<sdfsdf>" after_str = re.sub("[?|<|>|?|:]", " ", before_str) print(after_str) a a aa sdfsdf
538 PHP ssh2_scp_send fails to send files as intended
545 Who developed the "avformat-59.dll" that comes with FFmpeg?
539 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
537 Unable to install versioned in Google Colab
539 Understanding How to Configure Google API Key
© 2024 OneMinuteCode. All rights reserved.