WordPress at a glance
function is not described

get_url_in_content() WP 3.6.0

Extract and return the first URL from passed content.

No Hooks.

Return

String/false. The found URL.

Usage

get_url_in_content( $content );
$content(string) (required)
A string which might contain a URL.

Code of get url in content: wp-includes/formatting.php VER 5.1.1

<?php
function get_url_in_content( $content ) {
	if ( empty( $content ) ) {
		return false;
	}

	if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) {
		return esc_url_raw( $matches[2] );
	}

	return false;
}