Why my Python regular expression pattern run so slowly?

前端 未结 2 703
醉梦人生
醉梦人生 2021-01-22 08:50

Please see my regular expression pattern code:

#!/usr/bin/env python
# -*- coding:utf-8 -*-

import re

print \'Start\'
str1 = \'abcdefgasdsdfswossdfasdaef\'
m =         


        
2条回答
  •  忘掉有多难
    2021-01-22 09:25

    Just repost the answer and solution in comments from nhahtdh and Marc B:

    ([A-Za-z\-\s\:\.]+)+ --> [A-Za-z\-\s\:\.]+

    Thanks so much to nhahtdh and Marc B!

提交回复
热议问题