I'm trying to find any string of digits followed by a colon.
Here is an example string:
var str = " 234: all kinds of code";
Your regex is only successful when the string to search begins and ends with digits followed by colon. Try this: