To follow up my previous question, I'd like to ask if it's possible to add several arguments while using re.compile? I took "global warming" as an example in my previous question. What if I want to search for possible forms of "global warming" and also "climate change" in my database? Any solutions to that?
Asked
Active
Viewed 65 times
0
-
related: [Regex Alternation Order](https://stackoverflow.com/questions/23783053/regex-alternation-order) ... [Python regex: Alternation for sets of words](https://stackoverflow.com/questions/32284334/python-regex-alternation-for-sets-of-words) ... [Questions tagged regex-alternation](https://stackoverflow.com/questions/tagged/regex-alternation) – wwii Dec 19 '19 at 00:02
1 Answers
2
You can do this by using this: (global warming|climate change)
!
|
is separating the various options you have.

csabinho
- 1,579
- 1
- 18
- 28