I need a regex to capture/get number of input functions used in a python code.
I tried this: /input\((.)*\)/gm
But I don't want it to capture something like this:
someVariable = "input( )"
The regex I want should be able to do something like this:
Code:
number = int(input("Enter a number: "))
someVariable = "input( )"
number2 = int(input ("Number: ") )
The output should be 2 matches (input function in line 1 and 3). It should not match the input() in line 2.
P.S: I am new to regex, so it would be nice if you could also write an explanation for your regex solution.