<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">	
	<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
	<link rel="stylesheet" href="js_style.css" />
	<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
	<script src="lesson37.js"></script>
</head>
<body>
	<div id="less37">
		<div class="container">
			<div class="row">
				<div class="col-lg-12">
					<h2>Поиск номера и сайта и их замена</h2>
					<textarea id="text_37" cols="35" rows="5">Мой номер телефона 0681232233 , и ссылка на мой сайт https://primer.com.ua, номер телефона моего учителя 055123123 и его сайт primer.com</textarea><br>
					<button type="button" id='btn36' class="btn btn-outline-primary" style="margin-bottom: 15px;" onclick="Block()">Push</button>
					<h4 id="output37"></h4>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
function Block() {
    var output = document.getElementById("output37");
    var field = document.getElementById('text_37').value;
    var searchNumber = /[+?\d]+/gi;
    var searchSite = /((https:\/\/[a-z0-9]+\.[a-z-.]+)|(^[a-z0-9.-]+\.[a-z]+))/gi;
    
    field = field.replace(searchNumber, '*ТЕЛЕФОН ЗАБЛОКИРОВАН*');
    field = field.replace(searchSite, '*САЙТ ЗАБЛОКИРОВАН*');
    
    output.innerHTML = field;        
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.