我有一系列的字符串,大致上都是这样的。你知道吗
- Conf. w/attorney, defendant, bondsman. Magistrate ct., PA - Research - 2.7 hrs - 86 miles
我需要写一个正则表达式来匹配
- Conf. w/attorney, defendant, bondsman. Magistrate ct., PA -
字符串的- Research -
部分。你知道吗
但不是hrs
和miles
片段。你知道吗
x = re.findall('-[.^\-0-9]*-', line)
到目前为止我已经试过了,但是没有任何匹配结果。你知道吗
我肯定我只是写错了。你知道吗
如果要使用Regex执行此操作,可以尝试:
支票:https://regex101.com/r/uG0fI2/3
相关问题 更多 >
编程相关推荐