It's looking for any line that starts with "deny from ".
I've tried the following with no luck.
Code: Select all
$existingContent = file_get_contents(htaccess file);
preg_match_all('/deny from \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/', $existingContent, $matches);
//preg_match_all('/^deny from (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/', $existingContent, $matches);
//preg_match_all('/^deny from (\d{1,3}(?:\.\d{1,3}){1,3})$/', $existingContent, $matches);
//preg_match_all('/deny from \d[\d.]*$/', $existingContent, $matches);
$htaccessLines = $matches[0];