preg_match_all and tabs

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
schnulli
Forum Newbie
Posts: 1
Joined: Thu Oct 01, 2015 5:01 pm

preg_match_all and tabs

Post by schnulli »

Hi,

I want to use preg_match_all for working with a websites' source code.
Actually my code looks like this:

Code: Select all

preg_match_all("!<span class=\"strong\">CR: </span>(.*?)</p>!",$p2,$con);
	$erh = $con[1][0];
Anyway, the source code looks like that:

Code: Select all

<span class="strong">CR: </span>
				NC
			</p>
Between </span> and NC are one linefeed and four tabs, between NC and </p>there are one linefeed and three tabs.

How can I manage it to receive only NC as a result for $con[1][0]?
Post Reply