Hi, I have page designed in Django that has its own search engine. What I need help with is construction of regex that will filter only valid queries, which are consisting only of polish alphabet letters(both upper- and lowercase) and symbols * and ? , can anyone be of assistance?
EDIT: I tried something like that:
query_re = re.compile(r'^\w*[\*\?]*$', re.UNICODE)
if not query_re.match(self.cleaned_data['query']):
raise forms.ValidationError(_('Illegal character'))
but it also allows some invalid characters from different alphabets and wont allow *somest?ing* queries.