there is an OR operator | in regular expression (re module), but why there is no AND operator?
Asked
Active
Viewed 54 times
1 Answers
0
Because you can't have one section of a string be both 'abc' and 'def'. It is either one or the other.

Tim Roberts
- 48,973
- 4
- 21
- 30
-
It can be both `.*abc.*` and `.*def.*` – Barmar Mar 17 '21 at 03:37
-
`abcdef` matches both. – Barmar Mar 17 '21 at 03:37