Capturing repeating subpatterns in Python regex

前端 未结 4 1122
难免孤独
难免孤独 2020-11-22 05:21

While matching an email address, after I match something like yasar@webmail, I want to capture one or more of (\\.\\w+)(what I am doing is a little

4条回答
  •  余生分开走
    2020-11-22 06:00

    You can fix the problem of (\.\w+)+ only capturing the last match by doing this instead: ((?:\.\w+)+)

提交回复
热议问题