mozilla / nunjucks

A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)
https://mozilla.github.io/nunjucks/
BSD 2-Clause "Simplified" License
8.58k stars 640 forks source link

regex exmaple? #891

Open brucejcw opened 8 years ago

brucejcw commented 8 years ago

is there any regex example handling with string ?
eg:

{% if /.../.test('somestring') %}

how can i use regex to validate string

vecmezoni commented 8 years ago

have a look here https://github.com/mozilla/nunjucks/pull/882/files

brucejcw commented 8 years ago

@vecmezoni thanks

brucejcw commented 7 years ago

@vecmezoni any way to create dynamic regex ? like new RegExp(m, 'g')

perrygovier commented 5 years ago

The fact that you have to prefix with r should be added to the replace filter documentation