Home  >  Q&A  >  body text

python 如何判断string中包含“姓名 手机号”这样的行?

python 如何判断string中包含 姓名 手机号 这样的行?

例如, 判断 string 中是否包含:

张三 13912345678王麻子 15925469873迈克尔杰克逊 13802157869

请赐教,万分感谢!

巴扎黑巴扎黑2762 days ago638

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:08:26

    You can use regular expressions for mobile phone numbers, but it’s hard to judge the name.

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:08:26

    Mobile phone numbers are regular and can be matched. If you search many
    names on Baidu, import a Baijia surname or collect all the surnames, and then enter them into a list. When judging, judge whether the name contains a Baijia surname. , included, is the name...

    I have used this method to distinguish regions...

    reply
    0
  • PHPz

    PHPz2017-04-18 09:08:26

    Let’s judge by the regular expression of spaces plus numbers

    reply
    0
  • Cancelreply