I am trying to extract a number from a string using regex for javascript.
Test cases
value[0] ---> 0
value[1] ---> 1
object2value[0] ---> 0
object90 ---> no match
i tried using ([w]+)*?[d]
but it give
value[0] ---> value[0]
value[1] ---> value[1]
object2value[0] ---> object2value[0]
object90 ---> no match
how i can achieve this.