String matching formatting