In PHP, you can match whitespace, carriage return, and line feed using the following regular expression: