Hello everyone,
I have a large collection of php files written over the years and I need to properly replace all the short open tags into proper explicit open tags.
change "<?" into "<?php"
I think this regular expression will properly select them :
<\?(\s|\n|\t|[^a-zA-Z])
which takes care of cases like
<?//
<?/*
but I am not sure how to process a whole folder tree + detect the .php file extension + apply the regular expression + save the file it it has been changed.
I have the feeling this can be pretty straightforward if you master the right tools. (There is an interesting hack in the sed manual : 4.3 Example/Lowercase to Uppercase)
Maybe I'm wrong.
Or maybe this could be a one liner?
Thank you for your help.