Update utils.py

Fixed #2250 2250
Regex is better than string utils