String utility functions and regular expressions