Tests
Test: count
Template
{{ 'aaabbbccc'|replace('b', '.', 2) }}
Output Django (error) v1.10.1
Invalid filter: 'replace'
Output Jinja2 v2.8.0
aaa..bccc
Output Liquid v3.0.6
aaabbbccc
Output Nunjucks v2.5.0
aaa..bccc
Output Swig (error) v1.4.2
Invalid flags supplied to RegExp constructor '2'
Output Twig v1.24.2
aaa...ccc
Output Twigjs v0.9.5
aaabbbccc
Test: empty
Template
{{ 'aaabbbccc'|replace('', '.') }}
Output Django (error) v1.10.1
Invalid filter: 'replace'
Output Jinja2 v2.8.0
.a.a.a.b.b.b.c.c.c.
Output Liquid v3.0.6
aaabbbccc
Output Nunjucks v2.5.0
.a.a.a.b.b.b.c.c.c.
Output Swig v1.4.2
.aaabbbccc
Output Twig v1.24.2
aaabbbccc
Output Twigjs v0.9.5
aaabbbccc
Test: letter
Template
{{ 'aaabbbccc'|replace('b', '.') }}
Output Django (error) v1.10.1
Invalid filter: 'replace'
Output Jinja2 v2.8.0
aaa...ccc
Output Liquid v3.0.6
aaabbbccc
Output Nunjucks v2.5.0
aaa...ccc
Output Swig v1.4.2
aaa.bbccc
Output Twig v1.24.2
aaa...ccc
Output Twigjs v0.9.5
aaabbbccc
Test: number
Template
{{ 111222333|replace('2', '.') }}
Output Django (error) v1.10.1
Invalid filter: 'replace'
Output Jinja2 v2.8.0
111...333
Output Liquid v3.0.6
111222333
Output Nunjucks v2.5.0
111...333
Output Swig (error) v1.4.2
input.replace is not a function
Output Twig v1.24.2
111...333
Output Twigjs (error) v0.9.5
TypeError: string.split is not a function
Test: pattern
Template
{{ 'aaabbbccc'|replace('b*', '.') }}
Output Django (error) v1.10.1
Invalid filter: 'replace'
Output Jinja2 v2.8.0
aaabbbccc
Output Liquid v3.0.6
aaabbbccc
Output Nunjucks v2.5.0
aaabbbccc
Output Swig v1.4.2
.aaabbbccc
Output Twig v1.24.2
aaa...ccc
Output Twigjs v0.9.5
aaabbbccc