I rather suspected that the OP would come back with additions to his spec: perhaps a minimum substring length; perhaps something else. Of course, he might simply adapt my code to count three consecutive matched characters, or whatever else he might want. I believed I was clear when I wrote: "This does what you asked for"; but maybe not.
I did note the penultimate sentence about "bad words". It seemed to have no bearing on the relatively lengthy problem description which preceded it. It certainly didn't strike me as the "actual problem".
Anyway, that's an interesting take; let's wait to see what the OP says.
— Ken
In reply to Re^3: Finding a partial match
by kcott
in thread Finding a partial match
by jpys
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |