<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Extract numbers from a string
Step1:  Search patterns
See
Step2:  Search and capture patterns
Step3:  Case insensitive search
Step4:  Without re.compile()
Step5:  With re.compile()
<ASSISTANT_TASK:>
Python Code:
s = "Maison 3 pièce(s) - 68.05 m² - 860 € par mois charges comprises"
re.findall(r'\d+\.?\d*', s)
re.findall(r'\b\d+\.?\d*\b', s)
Explanation: Extract numbers from a string
End of explanation
s = "Maison 3 pièce(s) - 68.05 m² - 860 € par mois charges comprises"
if re.search(r'Maison', s):
    print("Found!")
else:
    print("Not found!")
if re.search(r'Appartement', s):
    print("Found!")
else:
    print("Not found!")
if re.match(r'Maison', s):
    print("Found!")
else:
    print("Not found!")
Explanation: Search patterns
See:
- https://docs.python.org/3/library/re.html#search-vs-match
- https://stackoverflow.com/questions/180986/what-is-the-difference-between-pythons-re-search-and-re-match
End of explanation
s = "Maison 3 pièce(s) - 68.05 m² - 860 € par mois charges comprises"
m = re.search(r'\b(\d+) pièce', s)
if m:
    print(int(m.group(1)))
else:
    print("Not found!")
m = re.search(r'\b(\d+\.?\d*) m²', s)
if m:
    print(float(m.group(1)))
else:
    print("Not found!")
m = re.search(r'\b(\d+\.?\d*) €', s)
if m:
    print(float(m.group(1)))
else:
    print("Not found!")
Explanation: Search and capture patterns
End of explanation
s = "Maison 3 PIÈce(s) - 68.05 m² - 860 € par mois charges comprises"
Explanation: Case insensitive search
End of explanation
m = re.search(r'\b(\d+) pièce', s, re.IGNORECASE)
if m:
    print(int(m.group(1)))
else:
    print("Not found!")
Explanation: Without re.compile()
End of explanation
num_pieces = re.compile(r'\b(\d+) pièce', re.IGNORECASE)
m = num_pieces.search(s)
if m:
    print(int(m.group(1)))
else:
    print("Not found!")
Explanation: With re.compile()
End of explanation
<END_TASK>