Setup pool counter for regex search

DEPLOYMENT: This should go with 1.24wmf10 or before because without it
regex searches are unlimited.

Change-Id: If979a7d25701098d9f0b1b9786b2bd38d7c1fbe7
Merge "Setup pool counter for regex search"