[英]Python regex to find alpha strings between dashes
我有一系列的字符串看起來都差不多。
- 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錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.