python-re
Replacing all special characters but the dot in a string also replaces the dot
I am trying to replace special characters by an underscore in a given string (a badly formatted file path) but I cannot get it to work.[详细]
2022-12-07 22:36 分类:问答How to write a python regular expression to find any two letters that appears at least twice
How to write a python regular expression to find any two letters that appears at least twice in the string without overlapping, like xyxy (xy) or aabcdefgaa (aa) aaaa (aa) abcadb (ab), but not like aa[详细]
2022-12-07 20:41 分类:问答How to remove URL from list of tweets?
I have a list of tweets that looks like this: tweet_list = [\'Justin Reid has been non-existent today No showed after talking Send him back to Houston where he clearly belongs\', \'❌Refer to Native A[详细]
2022-12-07 19:54 分类:问答how to use python re.sub()?
import re re.sub(\'[a-zA-Z0-9/*\\n\\u]\', \'\', string=\'\\n\\u3000\\u3000xyz\') error: File "<input>", line 2[详细]
2022-12-07 19:31 分类:问答