Search code examples
pythonpython-re

why there is no AND operator in regular expression?


there is an OR operator | in regular expression (re module), but why there is no AND operator?


Solution

  • Because you can't have one section of a string be both 'abc' and 'def'. It is either one or the other.