01.16 贪婪

2019-01-16  本文已影响0人  xxxQinli

什么是非贪婪:

*?

+?

??

{M,}?

{N,M}?

{,N}?

def main():

    print(re.search(r'\d+', 'abchs3482==sdd'))
    print(re.search(r'\d+?', 'abchs3482==sdd'))

    print(re.search(r'"name":".*?",', '====,"name":"yuting","age":18, "爱好":"编程",....'))




if __name__ == '__main__':
    main()

上一篇下一篇

猜你喜欢

热点阅读