aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-09-05 22:59:46 -0400
committerGitHub <noreply@github.com>2021-09-05 22:59:46 -0400
commitc91831a81722345ef7b4d20bd87c855903a7bca7 (patch)
treece6072fba40bc1d6145c1ae5456ea66bcfc1d0c7 /docs
parentb988417031bc0549b1075f73cf5ebb22dad24015 (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.md8
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>