Add support for string->int optimization when the regex replace optimization is used