protected function regexSearchReplace( $html ) {

		/* cherry pick likely content areas */
		// HTML5, ungreedy
		preg_match( '/(?:<main[^>]*>)(.*)<\/main>/isU', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// WP content area, greedy
		preg_match( '/(?:<div id="main"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// general content area, greedy
		preg_match( '/(?:<div id="content"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// specific PB content area, greedy
		preg_match( '/(?:<div class="entry-content"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		/* cull */
		// get rid of script tags, ungreedy
		$result = preg_replace( '/(?:<script[^>]*>)(.*)<\/script>/isU', '', $html );
		// get rid of forms, ungreedy
		$result = preg_replace( '/(?:<form[^>]*>)(.*)<\/form>/isU', '', $result );
		// get rid of html5 nav content, ungreedy
		$result = preg_replace( '/(?:<nav[^>]*>)(.*)<\/nav>/isU', '', $result );
		// get rid of PB nav, next/previous
		$result = preg_replace( '/(?:<div class="nav"[^>]*>)(.*)<\/div>/isU', '', $result );
		// get rid of PB share buttons
		$result = preg_replace( '/(?:<div class="share-wrap-single"[^>]*>)(.*)<\/div>/isU', '', $result );
		// get rid of html5 footer content, ungreedy
		$result = preg_replace( '/(?:<footer[^>]*>)(.*)<\/footer>/isU', '', $result );
		// get rid of sidebar content, greedy
		$result = preg_replace( '/(?:<div id="sidebar\d{0,}"[^>]*>)(.*)<\/div>/is', '', $result );
		// get rid of comments, greedy
		$result = preg_replace( '/(?:<div id="comments"[^>]*>)(.*)<\/div>/is', '', $result );

		return $result;
	}
protected function regexSearchReplace( $html ) {

		/* cherry pick likely content areas */
		// HTML5, ungreedy
		preg_match( '/(?:<main[^>]*>)(.*)<\/main>/isU', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// WP content area, greedy
		preg_match( '/(?:<div id="main"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// general content area, greedy
		preg_match( '/(?:<div id="content"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		// specific PB content area, greedy
		preg_match( '/(?:<div class="entry-content"[^>]*>)(.*)<\/div>/is', $html, $matches );
		$html = ( ! empty( $matches[1] ) ) ? $matches[1] : $html;

		/* cull */
		// get rid of script tags, ungreedy
		$result = preg_replace( '/(?:<script[^>]*>)(.*)<\/script>/isU', '', $html );
		// get rid of forms, ungreedy
		$result = preg_replace( '/(?:<form[^>]*>)(.*)<\/form>/isU', '', $result );
		// get rid of html5 nav content, ungreedy
		$result = preg_replace( '/(?:<nav[^>]*>)(.*)<\/nav>/isU', '', $result );
		// get rid of PB nav, next/previous
		$result = preg_replace( '/(?:<div class="nav"[^>]*>)(.*)<\/div>/isU', '', $result );
		// get rid of PB share buttons
		$result = preg_replace( '/(?:<div class="share-wrap-single"[^>]*>)(.*)<\/div>/isU', '', $result );
		// get rid of html5 footer content, ungreedy
		$result = preg_replace( '/(?:<footer[^>]*>)(.*)<\/footer>/isU', '', $result );
		// get rid of sidebar content, greedy
		$result = preg_replace( '/(?:<div id="sidebar\d{0,}"[^>]*>)(.*)<\/div>/is', '', $result );
		// get rid of comments, greedy
		$result = preg_replace( '/(?:<div id="comments"[^>]*>)(.*)<\/div>/is', '', $result );

		return $result;
	}
protected function regexSearchReplace ( $ html ) { /* cherry pick likely content areas */ // HTML5, ungreedy preg_match ( '/(?:<main[^>]*>)(.*)<\/main>/isU' , $ html , $ matches ) ; $ html = ( ! empty ( $ matches [ 1 ] ) ) ? $ matches [ 1 ] : $ html ; // WP content area, greedy preg_match ( '/(?:<div id="main"[^>]*>)(.*)<\/div>/is' , $ html , $ matches ) ; $ html = ( ! empty ( $ matches [ 1 ] ) ) ? $ matches [ 1 ] : $ html ; // general content area, greedy preg_match ( '/(?:<div id="content"[^>]*>)(.*)<\/div>/is' , $ html , $ matches ) ; $ html = ( ! empty ( $ matches [ 1 ] ) ) ? $ matches [ 1 ] : $ html ; // specific PB content area, greedy preg_match ( '/(?:<div class="entry-content"[^>]*>)(.*)<\/div>/is' , $ html , $ matches ) ; $ html = ( ! empty ( $ matches [ 1 ] ) ) ? $ matches [ 1 ] : $ html ; /* cull */ // get rid of script tags, ungreedy $ result = preg_replace ( '/(?:<script[^>]*>)(.*)<\/script>/isU' , '' , $ html ) ; // get rid of forms, ungreedy $ result = preg_replace ( '/(?:<form[^>]*>)(.*)<\/form>/isU' , '' , $ result ) ; // get rid of html5 nav content, ungreedy $ result = preg_replace ( '/(?:<nav[^>]*>)(.*)<\/nav>/isU' , '' , $ result ) ; // get rid of PB nav, next/previous $ result = preg_replace ( '/(?:<div class="nav"[^>]*>)(.*)<\/div>/isU' , '' , $ result ) ; // get rid of PB share buttons $ result = preg_replace ( '/(?:<div class="share-wrap-single"[^>]*>)(.*)<\/div>/isU' , '' , $ result ) ; // get rid of html5 footer content, ungreedy $ result = preg_replace ( '/(?:<footer[^>]*>)(.*)<\/footer>/isU' , '' , $ result ) ; // get rid of sidebar content, greedy $ result = preg_replace ( '/(?:<div id="sidebar\d{0,}"[^>]*>)(.*)<\/div>/is' , '' , $ result ) ; // get rid of comments, greedy $ result = preg_replace ( '/(?:<div id="comments"[^>]*>)(.*)<\/div>/is' , '' , $ result ) ; return $ result ; }
Cherry pick likely content areas, then cull known, unwanted content areas

@param string $html

@return string $html
Cherry pick likely content areas then cull known unwanted content areas