Javascript to find number after character (colon)
This question already has an answer here:
Alex already gave you the answer: str.match(/number:s+(d+)$/i)[1]
, which means the result at the index of 1. That index in the array is generated by the usage of the ()
in your regex. The first index (0) is the answer you've been getting.