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, 5 months ago
- Template tag "ifregex" and "ifnotregex" by arthurfurlan 2 years, 8 months ago
- Single Django App behind multiple Apache Proxies by chadmaine 4 years, 9 months ago
- Url filter middleware by limodou 4 years, 11 months ago
- ImageMagick commands from Django Templates by cogat 2 years, 9 months ago
Comments