ubuntu-buildroot/output/build/host-gawk-5.2.0/test/match1.awk

10 lines
254 B
Awk
Raw Normal View History

2024-04-01 15:19:46 +00:00
BEGIN {
data = "foooobazbarrrrr"
match(data, /(fo+).+(bar*)/, arr)
for (i = 0; i in arr; i++) {
printf("arr[%d] = \"%s\"\n", i, arr[i])
printf("arr[%d, \"start\"] = %s, arr[%d, \"length\"] = %s\n",
i, arr[i, "start"], i, arr[i, "length"])
}
}