Wordplay with Regular Expressions

Or, eat my Will Shortz.

I somehow got into a competition with a friend to think of the most words that followed the pattern of “pizza” (letter, vowel, repeated letter, vowel). The game didn’t last long, but the next day the problem was still bugging me, so I decided to write a php script to go through the scrabble dictionary and find them all, compiling a definitive list. So here they are, with the functions used to check each word:

408 "batty" words:

function check_batty($s) { return preg_match("/b[a-z][aeiouy]([a-z])\1[aeiouy]b/", $s); }

bacca baddy baffy baggy bally barre bassi basso bassy battu batty belle belly benne benni benny berry betta biddy biffy biggy billy bitty bobby bocce bocci boffo boggy bonne bonny bossy bubba bubby buddy buffi buffo buffy buggy bulla bully bunny buppy burro burry butte butty byssi cabby caddy calla canna canny carry catty cella celli cello cirri cissy civvy cobby cocci colly comma commy cotta cubby cuddy cully cuppa cuppy curry cusso cutty daddy daffy dagga dally datto dekko delly derry dilly dippy ditto ditty divvy dizzy dobby doggo doggy dolly donna donne dotty duddy dully dummy durra faddy faggy fanny fatty fella felly femme fenny ferry fesse fezzy fille fillo filly finny firry fizzy foggy folly fossa fosse fuddy fuggy fully funny furry fussy fuzzy fytte gabby gaddi gaffe gally gamma gammy gappy gassy gemma gemmy gesso giddy gilly gimme ginny golly gully gumma gummy gunny guppy gurry gussy gutta gutty hajji hallo hammy happy harry hello henna herry hillo hilly hinny hippo hippy hissy hobby hokku holla hollo holly hoppy hubby huffy hullo hurry hussy huzza jaggy jammy jazzy jello jelly jemmy jenny jerry jesse jetty jiffy jiggy jimmy jinni jolly jotty jutty kappa kelly kerry kibbe kibbi kiddo kiddy kissy kitty koppa kusso lassi lasso latte leggy lemma lezzy lippy lobby loggy lolly loppy lorry lossy lotte lotto luffa lyssa lytta mamma mammy manna marry massa masse massy matte mecca merry messy mezzo middy miffy mille minny missy moggy molly momma mommy morro mosso mossy motte motto muddy muggy mulla mummy murra murre murry mussy muzzy naggy nanny nappa nappe nappy natty navvy neddy nelly netty ninny nippy nitty nobby noddy nubby nutty paddy pally panne pappi pappy parry passe patty penna penne penni penny peppy perry petti petto petty piggy pinna pinny pitta pizza pommy poppa poppy posse potto potty puffy puggy pukka punny puppy pussy putti putto putty rabbi raggy rally rammy ratty rebbe recce ribby rille rotte rubby ruddy ruffe rummy runny rutty saggy sally sappy sassy savvy secco selle senna serry silly sirra sissy soddy soggy sonny soppy sorry sully summa sunna sunny surra sutta tabby taffy tally tammy tarre tarry tasse tatty tazza tazze teddy telly terra terry tikka tinny tippy titty tizzy toddy toffy tommy tonne tubby tulle tummy tunny tutti tutty villa villi vitta vuggy waddy walla wally webby welly wenny wicca widdy wiggy willy wirra witty worry wussy yabby yobbo yucca yukky yummy yuppy zappy zippy

65 "weewee" words:

function check_weewee($s) { return preg_match("/b([a-z]+)\1b/", $s); }

aa atlatl baba beebee beriberi bonbon booboo boubou bubu bulbul caca cancan caracara chichi chowchow coco coocoo couscous cuscus dada dikdik dodo doodoo dumdum eses froufrou furfur gaga gogo greegree grigri grugru guitguit haha hotshots juju kaka kavakava lavalava lulu mahimahi mama meme mm motmot mumu murmur muumuu nana nene palpal papa pawpaw pompom pupu sarsar tartar testes titi tsetse tsktsk tutu tzetze valval weewee

107 palindromes:

// Palindrome checker (impossible to do with just a regex)
function check_palindrome($s) { 
	return $s == strrev($s); 
}
// Recursive palindrome checker (I wrote this one first, not knowing about strrev())
function check_palindrome_recursive($s) {
	if (strlen($s) <= 1)
		return true;
	else if (substr($s,0,1) != substr($s,-1))
		return false;
	else
		return check_palindrome_recursive(substr($s,1,strlen($s)-2));
}

aa aba abba aga aha ala alula ama ana anna ava awa bib bob boob bub civic dad deed deified deked deled denned dewed did dud eke eme ere eve ewe eye gag gig hah halalah hallah heh huh kaiak kayak keek kook level madam marram mem mim minim mm mom mum naan nan noon nun oho ono otto oxo pap peep pep pip poop pop pullup pup radar redder refer reifier repaper reviver rotator rotor sagas sees selles sememes semes seres sexes shahs sis solos sos stats stets stots sulus tat tenet terret tet tit toot torot tot tut ulu vav waw wow yay zuz zzz

Would anybody be interested in seeing lists for any other patterns?