Post History
APL (Dyalog Unicode), 27 bytes Anonymous tacit prefix function '\w+' '.' '[^ ]'{≢⍺⎕S⍬⊢⍵}¨⊂ Try it online! '\w+' '.' '[^ ]'{…}¨⊂ apply the following anonymous lambda on each of the PCRE patt...
Answer
#2: Post edited
- # [APL (Dyalog Unicode)], 27 bytes
- <!-- language-all: lang-apl -->
- '\w+' '.' '[^ ]'{≢⍺⎕S⍬⊢⍵}¨⊂
- [Try it online!][TIO-kq5seyxl]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-kq5seyxl]: https://tio.run/##SyzI0U2pTMzJT///Xz2mXFtdQV0PiKPjFGLVqx91LnrUu@tR39TgR71rHnUBOVtrD6141NX0P@1R24RHvX2PuppBMr1bDq03ftQ2EaQyyBlIhnh4Bv9PUwCyvIL9/dSVPFJzcvIVyvOLclKU1LmQJYxzcgwUFMoNigzRZcBaYkpi8rBoi8kDQVQxBQUFJXUA "APL (Dyalog Unicode) – Try It Online"
- # [APL (Dyalog Unicode)], 27 bytes
- <!-- language-all: lang-apl -->
- Anonymous tacit prefix function
- '\w+' '.' '[^ ]'{≢⍺⎕S⍬⊢⍵}¨⊂
- [Try it online!][TIO-kq5seyxl]
- `'\w+' '.' '[^ ]'{`…`}¨⊂` apply the following anonymous lambda on each of the PCRE patterns (`⍺`) and the entire string (`⍵`):
- `⊢⍵` on the string
- `⍺⎕S⍬` find matches for the pattern
- `≢` tally (count) them
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-kq5seyxl]: https://tio.run/##SyzI0U2pTMzJT///Xz2mXFtdQV0PiKPjFGLVqx91LnrUu@tR39TgR71rHnUBOVtrD6141NX0P@1R24RHvX2PuppBMr1bDq03ftQ2EaQyyBlIhnh4Bv9PUwCyvIL9/dSVPFJzcvIVyvOLclKU1LmQJYxzcgwUFMoNigzRZcBaYkpi8rBoi8kDQVQxBQUFJXUA "APL (Dyalog Unicode) – Try It Online"
#1: Initial revision
# [APL (Dyalog Unicode)], 27 bytes <!-- language-all: lang-apl --> '\w+' '.' '[^ ]'{≢⍺⎕S⍬⊢⍵}¨⊂ [Try it online!][TIO-kq5seyxl] [APL (Dyalog Unicode)]: https://www.dyalog.com/ [TIO-kq5seyxl]: https://tio.run/##SyzI0U2pTMzJT///Xz2mXFtdQV0PiKPjFGLVqx91LnrUu@tR39TgR71rHnUBOVtrD6141NX0P@1R24RHvX2PuppBMr1bDq03ftQ2EaQyyBlIhnh4Bv9PUwCyvIL9/dSVPFJzcvIVyvOLclKU1LmQJYxzcgwUFMoNigzRZcBaYkpi8rBoi8kDQVQxBQUFJXUA "APL (Dyalog Unicode) – Try It Online"