Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -87,11 +87,11 @@ def filter_text(text):
|
|
87 |
phraseB = "rewritten text: "
|
88 |
pattern = f"(.*?){re.escape(phrase)}(.*)"
|
89 |
patternB = f"(.*?){re.escape(phraseB)}(.*)"
|
90 |
-
matchB = re.search(patternB, text)
|
91 |
-
|
92 |
if matchB:
|
93 |
filtered_text = matchB.group(2)
|
94 |
-
match = re.search(pattern, filtered_text)
|
95 |
if match:
|
96 |
filtered_text = match.group(2)
|
97 |
return filtered_text
|
|
|
87 |
phraseB = "rewritten text: "
|
88 |
pattern = f"(.*?){re.escape(phrase)}(.*)"
|
89 |
patternB = f"(.*?){re.escape(phraseB)}(.*)"
|
90 |
+
# matchB = re.search(patternB, text)
|
91 |
+
match = re.search(pattern, text, flags=re.DOTALL)
|
92 |
if matchB:
|
93 |
filtered_text = matchB.group(2)
|
94 |
+
match = re.search(pattern, filtered_text, flags=re.DOTALL)
|
95 |
if match:
|
96 |
filtered_text = match.group(2)
|
97 |
return filtered_text
|