我想从给定的字符串中提取一个子字符串-
string0 = 'Daily wage of the worker0.1- \nNone'
string1 = 'Daily wage of the worker0.2- \nInvalid'
string3 = 'Daily wage of the worker0.3- \nValid'
有50个类似格式的字符串。我想从每行中提取- \n
。什么是正确的正则表达式
我正在尝试re.search(r'^- \\n$', re.DOTALL)
。我需要做什么修改
Tags:
您可以匹配指定的模式:
输出:
相关问题 更多 >
编程相关推荐