我的 python 代码中有以下正则表达式,它真的很长。由于 python 是一种空格分隔的语言,我该如何清理它?
matches = re.findall("((?:jan(?:(?:.)?|(?:uary)?)|feb(?:(?:.)?|(?:ruary)?)|mar(?:(?:.)?|(?:ch)?)|apr(?:(?:.)?|(?:il)?)|may|jun(?:(?:.)?|(?:e)?)|jul(?:(?:.)?|(?:y)?)|aug(?:(?:.)?|(?:gust)?)|sep(?:(?:.)?|(?:ept(?:(?:.)?))?|(?:tember)?)|oct(?:(?:.)?|(?:ober)?)|nov(?:(?:.)?|(?:ember)?)|dec(?:(?:.)?|(?:ember)?)) (?:[12][0-9]|[1-9]))",fileText,re.IGNORECASE)
任何帮助将不胜感激。
最佳答案
关于python - 如何清理正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21491081/