I have a few files with python code and decorators like this:
@trace('api.module.function_name', info=None, custom_args=False)
The only difference between these decorators is the string 'api.module.function_name' - func name and module are different. And depending on the this param name sometimes this decorator is one-lined, some times it is two- or three-lined.
I want to replace these decorators with the other one - more simple, like "@my_new_decorator".
I thought about some regex but I have no idea if it's possible for such "fuzzy" search. I tried ^@trace([A-Za-z0-9]\, custom_args=False)$
But it doesn't work.
Is there a way to do it?
^\s*@trace\(.+\)$because you're matching one alphanumeric character and only matching at all if this is all at column 0.re.M