Web >> Development >> PHP >> Regular Expressions >> How to match any character inclusive of newline \n

use . meta-character with the /s modifier eg. preg_match("/^start(.*)end$/s",$string_having_newline,$matches) will extract anything within start ... end inclusive of newline characters.