Menu
Hey there,
I’m doing some source code processing with preg_match, and ideally, I’d like to search for a pattern, and then identify what line number the match occurred on with each match.
What is the best way to do this? Should I split my code by n, then attempt the match on each line, or is there an efficient way to do it with PREG_OFFSET_CAPTURE? Or something else even?
Thanks in advance!
-Matt