summaryrefslogtreecommitdiffhomepage
path: root/docs/cregex_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-10-19 15:50:51 +0200
committerTyge Løvset <[email protected]>2022-10-19 15:50:51 +0200
commit0441f3844410c64b7e2d4a2604b4254b851e64c8 (patch)
tree2b30f21536fd589b890fa4644732e963036a9113 /docs/cregex_api.md
parentbb3a457e5c2c9e6b069ab3dfba10f9d21686b035 (diff)
downloadSTC-modified-0441f3844410c64b7e2d4a2604b4254b851e64c8.tar.gz
STC-modified-0441f3844410c64b7e2d4a2604b4254b851e64c8.zip
Reverted back to c_forrrange from c_forloop. Still available but deprecated.
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 b715791d..0640f17b 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_forloop (k, cregex_captures(&re))
+ c_forrange (k, cregex_captures(&re))
printf("submatch %lld: %.*s\n", k, c_ARGsv(match[k]));
```
There is also a safe macro which simplifies this:
```c
c_formatch (it, &re, input)
- c_forloop (k, cregex_captures(&re))
+ c_forrange (k, cregex_captures(&re))
printf("submatch %lld: %.*s\n", k, c_ARGsv(it.match[k]));
```