I want to search a php file to find all calls to a functions I’ve defined in that file. I’ve got an array that contains all of the functions I want to search for. If the function’s name is Foo, then I’ve got:
match = re.search(r'!(function)Foo\(', line)
where line is the current line of code I’m looking at. I want this to match (doesn’t need to return anything, just tell me there was a match) all calls to the function, and not match when the function is declared. (I’m brand new to regex, but I’m already seeing how I now have two problems)
You may need some lookbehind:
It’ll not match if
functionis placed beforeFoo.