Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

can any one give me Regex to match any character including new lines

user-image
Question added by Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.
Date Posted: 2013/09/18
Umar Alharaky
by Umar Alharaky , Senior Systems Analyst & Quality Control , StarWays IT

Try this: 

(.|\n)*

In regular expressions, the dot or period is one of the most commonly used metacharacters. Unfortunately, it is also the most commonly misused metacharacter.

The dot matches a single character, without caring what that character is. The only exception are line break characters. In all regex flavors discussed in this tutorial, the dot does not match line breaks by default.

Hamdan AbuTaima
by Hamdan AbuTaima , System Developer , SelectMix.com

the correct REGX

.*\\r\\n

Deleted user
by Deleted user

try

.|\n

Louy Alakkad
by Louy Alakkad , Front End Developer , Alpha Apps

Use the "s" modifier

 

preg_match('/.*/s', $text, $match);

 

More Questions Like This