• 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 retrieve specific data onclick from database in a list format

laravel 5.6 bulk inserting json data

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Yii2 select2 database exception number of bound variables does not match number of tokens

Make Shipping Method fields Mandatory on Woocommerce checkout page

PDOException SQLSTATE[HY000] [2002] No such file or directory

hidden INPUT value not available in $_POST

Destroy session upon refresh

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Transpose and flatten multiple rows of array data [duplicate]

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

How avoid Moved Permanently The document has moved here

ORA-12546: TNS:permission denied error connection to remote oracle server

Send POST data via raw JSON with Postman

About Contact Privacy policy Terms and conditions