"How satisfied, if at all, are you with the following stadium facilities at the Arabian Gulf League/Arabian Cup/Arabian Super Cup/President's Cup matches you attend at the Hazza bin Zayed Stadium (Al Ain)?"
>>> import re
>>> re.sub('.*you attend at the ', '', "How satisfied, if at all, are you with the following stadium facilities at the Arabian Gulf League/Arabian Cup/Arabian Super Cup/President's Cup matches you attend at the Hazza bin Zayed Stadium (Al Ain)?")
'Hazza bin Zayed Stadium (Al Ain)?'
>>>
或使用:
>>> s = "How satisfied, if at all, are you with the following stadium facilities at the Arabian Gulf League/Arabian Cup/Arabian Super Cup/President's Cup matches you attend at the Hazza bin Zayed Stadium (Al Ain)?"
>>> s[s.find("you attend at the ") + 18:]
'Hazza bin Zayed Stadium (Al Ain)?'
>>>
inp = "How satisfied, if at all, are you with the following stadium facilities at the Arabian Gulf League/Arabian Cup/Arabian Super Cup/President's Cup matches you attend at the Hazza bin Zayed Stadium (Al Ain)?"
output = inp.split('you attend at the')[1]
print(output)
尝试使用正则表达式:
或使用:
你可以使用正则表达式:
(?:you attend at the )(.*)
你会在唯一的比赛中追上唯一的一组。你知道吗
我们可以在这里尝试使用
split
作为非regex选项:这张照片:
相关问题 更多 >
编程相关推荐