Skip to content

Commit c9c00a4

Browse files
refactor(#5224): rename groups-count to count in regex matched block
1 parent dc2bb04 commit c9c00a4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

eo-runtime/src/main/eo/tt/regex.eo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
# - `groups` - tuple of identified matched groups
7777
#
7878
# The block provides the next API to work with matched string subsequence:
79-
# - `groups-count` - to get amount of matched groups
79+
# - `count` - to get amount of matched groups
8080
# - `exists` - to check if matched block is not empty
8181
# - `next` - to get next matched block
8282
# - `text` - to get matched subsequence as `string`
@@ -88,7 +88,7 @@
8888
# here, in `matched`. Don't forget to remove this puzzle.
8989
[position start from to groups] > matched
9090
$ > matched
91-
groups.length > groups-count
91+
groups.length > count
9292
start.gte 0 > exists
9393
if. > next
9494
exists
@@ -154,7 +154,7 @@
154154

155155
# Tests that accessing groups count on non-matched block throws error.
156156
[] +> throws-on-getting-groups-count-on-not-matched-block
157-
((regex "/[a-z]+/").match "123").next.groups-count > @
157+
((regex "/[a-z]+/").match "123").next.count > @
158158

159159
# Tests that accessing groups on non-matched block throws error.
160160
[] +> throws-on-getting-groups-on-not-matched-block
@@ -245,12 +245,12 @@
245245
and. > @
246246
and.
247247
and.
248-
first.groups-count.eq 3
248+
first.count.eq 3
249249
(first.group 1).eq "hello"
250250
(first.group 2).eq "1"
251251
and.
252252
and.
253-
second.groups-count.eq 3
253+
second.count.eq 3
254254
(second.group 1).eq "world"
255255
(second.group 2).eq "2"
256256
((regex "/([a-z]+)([1-9]{1})/").compiled.match "!hello1!world2").next > first

0 commit comments

Comments
 (0)