search

Home  >  Q&A  >  body text

How can python's regular expression match two different results at the same time?

category = re.findall('(?<=compatible; )([^/]+)', line)
category = re.findall('(?<="-" ")([^"]+)', line)

How to make category match the data in these two regular expressions at the same time

How to merge two regular sentences together

Because if written like this, he will only recognize the following regular expression

黄舟黄舟2784 days ago554

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-18 11:02:13

    re.findall('(?<=compatible; )([^/]+) | (?<="-" ")([^"]+) ', line)

    reply
    0
  • Cancelreply