• 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

Detect a fetch request in PHP

How to install php yaml on CentOs?

Center point of multiple gps coordinates with php

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

Two buttons one form

Convert PHP array into HTML tag attributes separated by spaces

Laravel Unknown Column 'updated_at'

Getting public posts of a random user from Facebook API

PHP Find Array Index value in multi-line array

Transpose and flatten multiple rows of array data [duplicate]

PHP if in_array() how to get the key as well?

How to install php_imagick on wamp64

curl returning 301 error after migrating to https

Warning: sqlite_query() expects parameter 1 to be resource, string given

PHP Print to Network Printer

About Contact Privacy policy Terms and conditions