题解 | #参数解析#

参数解析

https://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677

import re
s=input()
pattern=re.compile('\".*?\"',re.DOTALL)
matchs=re.findall(pattern,s)
matchs.reverse()
for i in range(len(matchs)):
    matchs[i]=matchs[i].replace('\"',"")
s=re.sub(pattern,"regin",s)
ls=s.split(" ")
for x in ls:
    if x=="":
        ls.remove("")
    elif x=="regin":
        ls[ls.index("regin")]=matchs.pop()
print(len(ls))
for x in ls:
    print(x)

全部评论

相关推荐

03-27 17:33
门头沟学院 Java
代码飞升:同学院本,你要注意hr当天有没有回复过,早上投,还要打招呼要推销自己,不要一个劲投
点赞 评论 收藏
分享
谁知道呢_:要掉小珍珠了,库库学三年,这个结果
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务