Replace regex with string comparison