I have a question about changing the string to a regular expression.
"It's seven. 12, 2016" String
"December 7, 2016"
How do I change to? I'm going to use re.sub function and I'm wondering how to make a regular expression.
Simply, I think you can match the part with the numbers.
import re message = "7. 12, 2016" m = re.sub(r)(\d+).\s+(\d+),\s+(\d+)",r"\3year\February \1",message) print(m)
Other
1022 In Java servlet, when SHA-256 sends WW-Authenticate header for digest authentication, the client does not return the result.
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
881 /usr/bin/google-chrome:symbol lookup error:/usr/bin/google-chrome: undefined symbol:gbm_bo_get_modifier
© 2024 OneMinuteCode. All rights reserved.