• 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

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

Update Total in checkout of Woocommerce with Ajax Request

Substitute integers and dots with regex [duplicate]

Magento 2 - How to add new block to admin panel in product page?

Laravel implode array items to new lines

Laravel 5.2: Unable to locate factory with name [default]

shell errors running php exec

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

Search for array row with specific column value and return another value from qualifying row

curl returning 301 error after migrating to https

Display the WooCommerce product price inside a custom function

Issue with laravel eloquent model property

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

loop through an anchor id

Combining a describing and one array with data

About Contact Privacy policy Terms and conditions