aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-06 23:12:15 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-06 23:12:15 -0400
commit8670cbf9435c1ed20120f8106d2e58c77f57a552 (patch)
tree01419a7e853020dafda5f72cce70423b2a69ab37
parenta38d023da11ffb5a5d7aca480d121129315eb64f (diff)
Make {start} and {end} non-capturing
-rw-r--r--builtins/text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtins/text.c b/builtins/text.c
index 4cb7c7e9..dc601e57 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -1552,7 +1552,7 @@ pat_t parse_next_pat(Text_t pattern, text_iter_t *state, int64_t *index)
break;
case 'e':
if (strcasecmp(prop_name, "end") == 0) {
- return PAT(PAT_END);
+ return PAT(PAT_END, .non_capturing=!negated);
} else if (strcasecmp(prop_name, "email") == 0) {
return PAT(PAT_FUNCTION, .fn=match_email);
} else if (strcasecmp(prop_name, "emoji") == 0) {
@@ -1582,7 +1582,7 @@ pat_t parse_next_pat(Text_t pattern, text_iter_t *state, int64_t *index)
break;
case 's':
if (strcasecmp(prop_name, "start") == 0) {
- return PAT(PAT_START);
+ return PAT(PAT_START, .non_capturing=!negated);
}
break;
case 'u':