Reputation: 392
Trying to implement a regex script that gets the name of each function and returns them to a text file. The returning to text file part I got, the part I need some pointers in I don't.
# I just want to extract "name_i_want"
def name_i_want(self):
Upvotes: 1
Views: 47
Reputation: 4095
A regex for this could be:
(?<=def )(\w+)(?=\()
Working regex example:
Upvotes: 2