summaryrefslogtreecommitdiffhomepage
path: root/docs/cregex_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-23 13:17:22 +0200
committerTyge Løvset <[email protected]>2022-09-23 13:17:22 +0200
commit2c83996f1ad7ac7176833d1ecb76f59120bf52cd (patch)
tree495527c129d630b67aed0d8528c70ef5aa418106 /docs/cregex_api.md
parent0ec40a5819a619b6b2777f24c555a8953e99ea9b (diff)
downloadSTC-modified-2c83996f1ad7ac7176833d1ecb76f59120bf52cd.tar.gz
STC-modified-2c83996f1ad7ac7176833d1ecb76f59120bf52cd.zip
Reverted c_forrange() macro with 3 or more args: swapped 1st and 2nd arg again.
Diffstat (limited to 'docs/cregex_api.md')
-rw-r--r--docs/cregex_api.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/cregex_api.md b/docs/cregex_api.md
index 5f7e9136..2a0b22a8 100644
--- a/docs/cregex_api.md
+++ b/docs/cregex_api.md
@@ -128,13 +128,13 @@ To iterate multiple matches in an input string, you may use
```c
csview match[5] = {0};
while (cregex_find(&re, input, match, cre_m_next) == cre_success)
- c_forrange (int, k, cregex_captures(&re))
+ c_forrange (k, int, cregex_captures(&re))
printf("submatch %d: %.*s\n", k, c_ARGsv(match[k]));
```
There is also a safe macro which simplifies this:
```c
c_formatch (it, &re, input)
- c_forrange (int, k, cregex_captures(&re))
+ c_forrange (k, int, cregex_captures(&re))
printf("submatch %d: %.*s\n", k, c_ARGsv(it.match[k]));
```