finding first >

I want to erase some php code between a <? and a ?> in HTML containing a keyword, the problem is it finds the last > and wipes out everything before it

how do i specify for it to stop searching after the first >?

perl -i -p0e 's/<\?php.*keyword.*\?>//s'

there's many lines of php code in the document so what this does is erases until the last > but i dont want it to go that far

thanks!

perl -i -p0e 's/<\?php.*?keyword.*?\?>//s'

It is called "non-greedy" matching.

thanks for the quick response!