summaryrefslogtreecommitdiffhomepage
path: root/docs/cregex_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-26 08:08:47 +0200
committerTyge Løvset <[email protected]>2022-09-26 08:08:47 +0200
commitca01dd726e2ed8f8b69f8ff08855e80f4eea7247 (patch)
tree0ce1594c39d18a93212f066fd8c3c2477fc6f22b /docs/cregex_api.md
parentad5be4349232bbba96c0974bc2693ec7331c4b12 (diff)
downloadSTC-modified-ca01dd726e2ed8f8b69f8ff08855e80f4eea7247.tar.gz
STC-modified-ca01dd726e2ed8f8b69f8ff08855e80f4eea7247.zip
DEPRECATED: c_forrange(): replaced with c_forloop(). This uses 'long long' as iter type, i.e. "%lld" printf format.
crange_from() renamed to crange_make(). More docs.
Diffstat (limited to 'docs/cregex_api.md')
-rw-r--r--docs/cregex_api.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/cregex_api.md b/docs/cregex_api.md
index 2a0b22a8..66b97834 100644
--- a/docs/cregex_api.md
+++ b/docs/cregex_api.md
@@ -128,14 +128,14 @@ 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 (k, int, cregex_captures(&re))
- printf("submatch %d: %.*s\n", k, c_ARGsv(match[k]));
+ c_forloop (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_forrange (k, int, cregex_captures(&re))
- printf("submatch %d: %.*s\n", k, c_ARGsv(it.match[k]));
+ c_forloop (k, cregex_captures(&re))
+ printf("submatch %lld: %.*s\n", k, c_ARGsv(it.match[k]));
```
## Using cregex in a project