• 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

Load a .env file with PHP

Twig - How to check if variable is a number / integer

Limit of log line written to Apache Errorlog from mod php error_log

PHP/HTML: Creating A SubMenu

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

PHP array slice from position + attempt to return fixed number of items

Laravel get user data with profile

How to redirect to another page after n seconds in wordpress without using javascript?

PHP Deprecated issue when running artisan command

Wordpress 'post_type_link' hides permalink

Nginx disallowing execution of PHP in uploads directory with Magento

Access relation of pivot table in Laravel

calling server using nusoap with complextype

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

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

About Contact Privacy policy Terms and conditions