• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to make dot match newline characters using regular expressions

phpregex


PHP Snippet 1:

'/<div>(.*)<\/div>/s'

PHP Snippet 2:

'/<div>(.*?)<\/div>/s'

PHP Snippet 3:

'/<div>([^<]*)<\/div>/'

PHP Snippet 4:

'#<div>([^<]*)</div>#'

PHP Snippet 5:

%\<div\>([\s\S]*)\</div\>%

PHP Snippet 6:

(?s)/<div>(.*?)<\/div>

PHP Snippet 7:

(.|\n)

PHP Snippet 8:

'/<div>(\n*|.*)<\/div>/i'

Related Snippets

Convert regular text to array using notepad++

What is the difference between client-side and server-side programming?

HTML and PHP in one file

Convert every two values of an associative array into key-value pairs

Add record for each array elements if missing in table

laravel sanctum Route [login] not defined

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

Add bold text and line break into Laravel Notification Email

Store multiple fields in JSON column (Nova CMS)

Laravel multi auth - Authentication user provider [] is not defined

Unable to get password for the instance created from AMI

php - add comma thousands separator but remove trailing zeros

With doctrine ODM, can I embed many subdocuments in a main document?

Symfony autowiring issues since docker update

Laravel Model save() & update() Not Saving

About Contact Privacy policy Terms and conditions