Hello, I've been studying PHP for a while now, and am tackling my biggest project so far. I need to parse python code (which I'm already doing) and color code it. I need to get a word RIGHT before the ( symbol. I've tried just about everything, and can't get it to work! Basically I need to parse like below:
but in PHP I want to get MyFunction ONLY. Because I'm coloring functions, I don't wanna color the object or class, or the variables. Only the function, so I figure in theory i need to find the ( and somehow go back one word in the string.
It seems so simple, but none of the commands I've tried have worked, and I can't find anything online!