diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-09-05 22:59:46 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-09-11 16:05:39 -0400 |
commit | b52f244cb26718487053835e4b9a026a32c40412 (patch) | |
tree | 2bb29fe0e962776c8527562ddedab8d83023ee50 /docs | |
parent | 39a704e2afb3e0103824d9e202de91a43853c374 (diff) |
Anki template regex helper updates (#1934)
* Update regexReplace and regexMatch to support content arguments
* Update documentation
Diffstat (limited to 'docs')
-rw-r--r-- | docs/templates.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/templates.md b/docs/templates.md index 1cc7e210..638c79a6 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -146,7 +146,8 @@ Uses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScr <details> <summary>Syntax:</summary> - <code>{{#regexReplace <i>regex</i> <i>replacement</i> <i>[flags]</i>}}<i>text-to-modify</i>{{/regexReplace}}</code> + <code>{{#regexReplace <i>regex</i> <i>replacement</i> <i>[flags]</i>}}<i>text-to-modify</i>{{/regexReplace}}</code><br> + <code>{{#regexReplace <i>regex</i> <i>replacement</i> <i>[flags]</i> <i>[text-to-modify]...</i>}}{{/regexReplace}}</code><br> * _`regex`_ <br> The raw string used to create the regular expression. This value is passed to the [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor. @@ -156,6 +157,7 @@ Uses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScr Optional flags to pass to the [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor. * _`text-to-modify`_ <br> The text that the regular expression is applied to. + If multiple arguments are present, they are all concatenated. </details> <details> <summary>Example:</summary> @@ -178,7 +180,8 @@ Uses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScr <details> <summary>Syntax:</summary> - <code>{{#regexMatch <i>regex</i> <i>[flags]</i>}}<i>text-to-modify</i>{{/regexMatch}}</code> + <code>{{#regexMatch <i>regex</i> <i>[flags]</i>}}<i>text-to-modify</i>{{/regexMatch}}</code><br> + <code>{{#regexMatch <i>regex</i> <i>[flags]</i> <i>[text-to-modify]...</i>}}{{/regexMatch}}</code><br> * _`regex`_ <br> The raw string used to create the regular expression. This value is passed to the [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor. @@ -186,6 +189,7 @@ Uses a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScr Optional flags to pass to the [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor. * _`text-to-modify`_ <br> The text that the regular expression is applied to. + If multiple arguments are present, they are all concatenated. </details> <details> <summary>Example:</summary> |