Monday 27 June 2011

regular expression for checking the text without specified extension

Hi ,
This regular expression example is useful to check whether our SQL queries accidentally contain database name ,

like, "SELECT purchases.* from shopdatabase.purchases" .

For finding and removing the database names from sql ,
use regular expression pattern " shopdatabase\.[^(com|php)] "
where the " com|php " is the extensions we want to avoid.