In computing, a backreference is an item in a regular expression equivalent to the text matched by an earlier pattern in the expression.
Hey, I still believe WWE holds the rights. http://tess2.uspto.gov/bin/showfield?f=toc&state=4001:re8125.1.1&p_search=searchss&p_L=50&BackReference=&p_plural=yes&p_s_PARA1=live&p_tagrepl~:=PARA1$LD&expr=PARA1+AND+PARA2&p_s_PARA2=nWo&p_tagrepl~:=PARA2$COMB&p_op_ALL=AND&a_default=search&a_search=Submit+Query&a_search=Submit+Query nWo in all forms is owned by either WWE Inc. or WCW Inc., but they both have the same corporate address, so I assume they are both owned by Vince.
How about a Perl compatible regular expression for grep? I guess that's an algorithm. This one will search for seven-letter palindromes: grep -P '(?=^.{7}$)(.)(.)(.).\3\2\1' /path/to/your/dictionary The -P flag let's grep recognize perl compatible regular expressions (PCRE). The (?=^.{7}$) looks ahead to make sure it's matching a seven-letter word. The \1 is a backreference to the first (.) which matches any character. But now it has to match it again, except we're asking it to match in reverse order, \3\2\1 instead of \1\2\3. Then we have a single dot for the fourth letter, which will match any character. Just add or subtract subexpressions "(.)" as needed, along with the appropriate number backreferences "/1" to find palindromes. This is the output from grepping the TWL (the Scrabble dictionary): deified halalah reifier repaper reviver rotator sememes