I'm trying to extra the name of a module from some verilog code. For example:
module uart (inputs, outputs, etc)
I know I can use pythons slicing to get a substring, but that only uses indexes. I need to make it so that it slices kind of like this: string[6: (], where it slices up until the first instance of a parentheses. I was thinking of using string.find to find the index first parentheses and substituting that into the slice, but I'm curious if there's a better way to do this, maybe using regular expressions or something?