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.48k stars 635 forks source link

Match Strings Using Regular Expression #1414

Open Beau-Yang opened 1 year ago

Beau-Yang commented 1 year ago

Hi, I have one question about how to use nunjucks to match strings using regular expressions.

I have a string in the format like "Title: A Content: B" and I want to extract A and B respectively. The documentation of nunjucks only says that the regular expressions in it have the test() method which is used to return whether the pattern exists instead of the content. Is there a way to match strings?

Thanks in advance.

NextThread commented 11 months ago

hey, can I work on this issue