我想用Python编写一个正则表达式,从下面的字符串中提取'1994年6月28日',并将june转换为6:
fur = "missed intake office visit on 28 june 1994 at sierra vista nursing homesuicidal behavior hx of suicidal be"
我试过:
fur.extract(r'(?P<day>\d?\d)\s(?P<month>\W+)\s(?P<year>\d+)')
六月可以有多种形式,包括:“六月”、“六月”、“六月”、“六月;”等等
你可以试试这个:
输出:
您可以使用以下正则表达式:
这将产生三组输出:
第一天:就是这一天
第二个:是月份名称
第三个:是年份
输出为:
你只需要在六月份或其他月份换衣服?如果你只需要在六月改变,我想这已经足够了
相关问题 更多 >
编程相关推荐