The `contains` and `{starts,ends}_with` methods of `str` can solve many simple regex cases. cf. #587