randydev commited on
Commit
155c78b
·
verified ·
1 Parent(s): fa1cfe3

Create helper_regex.py

Browse files
Files changed (1) hide show
  1. 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