0
除了第一行使用Python 3之外,有人能帮我剪切JOIN和ON关键字之间的所有字符串吗?Python - 剪切两个字符串之间的所有单词
输入数据赋给变量
input_txt=
date_dim date_dim_all
INNER JOIN main_fact_response
ON (date_dim_all.response_date = main_fact_response.response_date)
LEFT JOIN dim_fore_main
ON (dim_fore_main.id = fact_fore_respond.id)
LEFT JOIN fact_fore_resi
ON (fact_fore_resi.fore_re = fact_fore_respond.fore_re
INNER JOIN fact_fore_respond fact_fore_respond_merit
ON (
fact_fore_respond_merit.fore_respond = fact_fore_r
espond.fore_respond
输出数据
date_dim date_dim_all,
main_fact_response,
dim_fore_main,
fact_fore_resi,
fact_fore_respond fact_fore_respond_merit
以及在哪里欣赏取悦你已经尝试什么还没有得到** **你完成任务? –
我能够获取JOIN和ON关键字之间的所有字符串。有没有办法在第一个INNER JOIN之前包含字符串。 x = re.findall(r'JOIN(。*?)ON',data,re.DOTALL) print(x) –
然后将您的代码添加到您的问题。正确格式化。您提出问题的方式看起来像免费编码服务的分配。 –