I am building a forum application in Django and I want to make sure that users dont enter certain characters in their forum posts. I need an efficient way to scan their whol
re.match and re.search behave differently. Splitting words is not required to search using regular expressions.
re.match
re.search
import re symbols_re = re.compile(r"[^<>/\{}[]~`]"); if symbols_re.search(self.cleaned_data('topic_message')): //raise Validation error