How do I do an "OR" for my python regex? -


re.compile("abc") 

i "abc" or "xyz".

use |:

re.compile("abc|xyz") 

it's worth perusing regular-expression.info detailed information regular expression howto , re — regular expression operations python documentation.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -