Palidrome machine using recursin and regex