summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--lib/regex/myr-regex.39
2 files changed, 6 insertions, 5 deletions
diff --git a/README.md b/README.md
index 578f96f..3b0ba9c 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ const main = {
str = "match against this!"
match regex.compile(".*")
| `std.Ok r: re = r
- | `std.Fail m: std.fatal("couldn't compile regex: {}\n", m)
+ | `std.Err m: std.fatal("couldn't compile regex: {}\n", m)
;;
match regex.exec(re, str)
| `std.Some _: std.put("regex matched\n")
diff --git a/lib/regex/myr-regex.3 b/lib/regex/myr-regex.3
index 6e8f018..46bb998 100644
--- a/lib/regex/myr-regex.3
+++ b/lib/regex/myr-regex.3
@@ -167,17 +167,18 @@ Space separator unicode property
use regex
const main = {
- match regex.compile(pat)
var i
- | `std.Success re:
+
+ match regex.compile(pat)
+ | `std.Ok re:
match regex.exec(re, text)
| `std.Some matches:
for i = 0; i < matches.len; i++
- std.put("Match %i: %s\n", i, match[i])
+ std.put("Match {}: {}\n", i, matches[i])
;;
| `std.None: std.put("Text did not match\n")
;;
- | `std.Failure err:
+ | `std.Err err:
std.put("failed to compile regex")
;;
}