Implement scan/2 filter (#1961)

This commit is contained in:
itchyny authored and GitHub committed 2023-07-04 07:48:29 +09:00
1 parent 83f375cc83
commit 4dc2a2fb9d
2 files changed
+9 -4

No files matched your search

+4
View File
@@ -126,6 +126,10 @@ gsub("^.*?a"; "b")
["a,b, c, d, e,f",", a,b, c, d, e,f, "]
[[["a,b:c, d, e,f"],["a,b:c:d:e,f"],[", ",", ",", "]],[[":a,b, c, d, e,f, "],[":a,b:c:d:e,f:"],[", ",", ",", ",", ",", "]]]
[.[] | scan("b+"; "i")]
["","bBb","abcABBBCabbbc"]
["bBb","b","BBB","bbb"]
# reference to named captures
gsub("(?<x>.)[^a]*"; "+\(.x)-")
"Abcabc"