Spaces:
Running
Running
Create helper_regex.py
Browse files- helper_regex.py +9 -0
helper_regex.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import re
|
2 |
+
|
3 |
+
def is_blocked_markdown_code(message):
|
4 |
+
pattern = r"(?:python|py|javascript|js|bash|sh|html|go|cpp|c|json)\n.*?"
|
5 |
+
match = re.search(pattern, message, re.DOTALL | re.IGNORECASE)
|
6 |
+
if match:
|
7 |
+
return True
|
8 |
+
else:
|
9 |
+
return False
|