-2

I have string like below i want to extract the number from the string. so i have used the following regex,it is not removing the last bracket even though i have used global replace.how to write the regex so it removes all the non digit characters even it is in the beginning or in the end

enter image description here

yasarui
  • 6,209
  • 8
  • 41
  • 75

1 Answers1

0

Your regex means : get the non digit from the start of the string, and end with non non digit (= digit), that's the reason your result come from.

If you want to get the number and the string's style is the same.You can use this:

enter image description here