W#Sb&[email protected] KXWb:b@>2.$1b
a, b are cmdline args; s is space; XW is `\w` (implicit)
W While
# length of
Sb longest suffix of b (the current word)
is nonzero (i.e. length of b is at least 2)
& and
@b first character of b
.s concatenated to a space
. concatenated to the following regex...
XW word character: \w
K with Kleene star operator: \w*
C wrapped in a capture group: (\w*)
a~ matches somewhere in a (the definitions)
do:
b: Assign to b
b@>2 all but the first two characters of b
.$1 concatenated to the contents of the regex capture group
b Output the final value of b
W#Sb&[email protected] KXWb:b@>2.$1b
; a, b are cmdline args; s is space; XW is `\w` (implicit)
W ; While
# ; length of
Sb ; longest suffix of b (the current word)
; is nonzero (i.e. length of b is at least 2)
& ; and
@b ; first character of b
.s ; concatenated to a space
. ; concatenated to the following regex...
XW ; word character: \w
K ; with Kleene star operator: \w*
C ; wrapped in a capture group: (\w*)
a~ ; matches somewhere in a (the definitions)
; do:
b: ; Assign to b
b@>2 ; all but the first two characters of b
.$1 ; concatenated to the contents of the regex capture group
b ; Output the final value of b