1 2 3 4 5 6 7 8 9 10 | import re
from django import template
register = template.Library()
@register.filter
def match(value, regex):
"""Usage: {% if value|match:"regex" %}"""
return re.match(regex, value)
|
More like this
- location context_processor by gsf0 2 years, 9 months ago
- Template tag "ifregex" and "ifnotregex" by arthurfurlan 3 years ago
- Single Django App behind multiple Apache Proxies by chadmaine 5 years ago
- Url filter middleware by limodou 5 years, 2 months ago
- apache authentication via cookies by sean 5 years, 2 months ago
Comments