Find words whose first and last three letters are equal: Difference between revisions

Add Red
(Added XPL0 example.)
(Add Red)
Line 672:
for IN.IO.lines { .say if .chars > L and .substr(0,N) eq .substr(*-N,*) }
</lang>
{{out}}
<pre>
antiperspirant
calendrical
einstein
hotshot
murmur
oshkosh
tartar
testes
</pre>
 
=={{header|Red}}==
<lang rebol>Red[]
 
foreach word read/lines %unixdict.txt [
if all [
greater? length? word 5
equal? take/part copy word 3 take/part/last copy word 3
][
print word
]
]</lang>
{{out}}
<pre>
1,808

edits