dima85,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
</head>
<body>
<textarea id="h" name="" rows="12" >text text
text
id 34355
text text
id 35235
text
text
id 45346
</textarea>
<script>
var line = "35235", reg = new RegExp("((id)\\s+(\\d+))[^\\d]+?"+line, "mig");
h.value = h.value.replace(reg, "$1")
</script>
<textarea id="k" name="" rows="12" >text text
text
id 34355
text text
id 35235
text
text
id 45346
</textarea>
<script>
var line = "45346", reg = new RegExp("((id)\\s+(\\d+))[^\\d]+?"+line, "mig");
k.value = k.value.replace(reg, "$1")
</script>
</body>
</html>