Rahul Sharma Rahul Sharma - 4 months ago 10
Javascript Question

Regular expression to return text between ( ) parenthesis

i need the inner content of parenthesis of

(5*6)
i.e.
5*6


i tried using:

/\((.*)\)/g


But unable to get
5*6
. How can I do this?

Answer

I think that the following regular expression does the trick:

/\d*[*\-\+\\]\d*/g

You could verify this here

Comments