• 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

Remove categories with all childs derived from parent category

Substitute integers and dots with regex [duplicate]

Render the content of default_filter.php in Joomla front-end

WooCommerce Subscriptions: Remove role on cancelled subscription

Woocommerce redirect after add-to-cart error

Adding Multiple Custom Post Types in Wordpress

Using Associative arrays

Input and output values for php into the browser?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Get sum of arrays inside array

Prestashop webservice API creating cart rules

Laravel 5 session not persisting after user is logged in

Parameter is not sent to Laravel route in Ajax

Select option from dropdown menu with PHP and mySql

Google API Heatmap Layer exception, why?

About Contact Privacy policy Terms and conditions