Similar Items: Logic Meets Algebra: the Case of Regular Languages