regex to match several string in Python
<p>I have questions with regex in Python.</p>

<p>Possible variations can be </p>

<p>10 hours, 12 weeks or 7 business days.</p>

<p>I want to have my regex something like </p>

<pre><code>string = "I have an 7 business day trip and 12 weeks vacation."
re.findall(r'\d+\s(business)?\s(hours|weeks|days)', string)
</code></pre>

<p>so that I expect to find "7 business day" and "12 weeks" but it returns None</p>

<p>I've matched " trip and " between "7 business day" and "12 weeks"</p>

<pre><code>import re
string = "I have an 7 business days trip and 12 weeks vacation."
print(re.findall(r'(\d+\sbusiness\sdays?)\strip\sand\s(\d+\s(?:hours?|weeks?|days?))\svacation', string))
</code></pre>

python regex