yasserrmd commited on
Commit
f7ee2da
·
verified ·
1 Parent(s): 98f45cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -19,7 +19,7 @@ def query(payload):
19
 
20
  # Extract only Python code from text
21
  def extract_python_code(text):
22
- code_pattern = r"```python(.*?)```"
23
  match = re.search(code_pattern, text, re.DOTALL)
24
  if match:
25
  return match.group(1).strip()
 
19
 
20
  # Extract only Python code from text
21
  def extract_python_code(text):
22
+ code_pattern = r"```(?:python)?(.*?)```"
23
  match = re.search(code_pattern, text, re.DOTALL)
24
  if match:
25
  return match.group(1).strip()