我有一系列的字符串看起来都差不多。
- 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)
到目前为止,我一直在尝试这种方法,但是不会返回任何匹配结果。
我确定我只是在写RE错误。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句