【发布时间】:2023-01-19 12:31:57
【问题描述】:
如何从给定字符串中找到提到的子字符串旁边的子字符串。
例如:
string = "无法增加索引orcl_index的空间。索引orcl_index的空间应该增加250mb"
这里的指标子字符串是“index”,所需的输出将是“orcl_index”。
我尝试了以下代码,但不确定如何继续
my_string = "unable to increase the space of the index orcl_index. The space for the index orcl_index should be increased by 250mb"
print(my_string.split("tablespace",1)[1])
a= my_string.split("tablespace",1)[1]
b= a.strip()
print(b)
Output:" orcl_index should be increased by 250mb"
Required output: "orcl_index"
【问题讨论】:
标签: python robotframework