我试图编写一个正则表达式,该表达式返回一个字符串,该字符串位于字符串之前。例如:我想获取字符串以及位于“ 15/08/2017”
之前的空格。a='''S
LINC SHORT LEGAL TITLE NUMBER
0037 471 661 1720278;16;21 172 211 342
LEGAL DESCRIPTION
PLAN 1720278
BLOCK 16
LOT 21
EXCEPTING THEREOUT ALL MINES AND MINERALS
ESTATE: FEE SIMPLE
ATS REFERENCE: 4;24;54;2;SW
MUNICIPALITY: CITY OF EDMONTON
REFERENCE NUMBER: 172 023 641 +71
----------------------------------------------------------------------------
----
REGISTERED OWNER(S)
REGISTRATION DATE(DMY) DOCUMENT TYPE VALUE CONSIDERATION
---------------------------------------------------------------------------
--
---
172 211 342 15/08/2017 AFFIDAVIT OF $610,000 CASH & MTGE'''
SURVIVING JOINT
TENANT
应该返回
172 211 342
这是我到目前为止拼凑的表情:
re.match("(.*?)15/08/2017",a).group()
返回
'172 211 342 15/08/2017'