Forum Moderators: open
I am looking for - no success - by a script which reading a source code from a search engine in a <textarea> or <iframe> and split out all links.
Links:' The 'substrings' which starting by 'http' and ends by 'htm or html or asp or xml or shtml or '/blank space''.
If you know any script to do this task. Please give the url where you found it!
Many thanks for any collaboration.
G.
<script>
function spliturl(str){
str = 'boo haa href="http://www.foo.com/doo.htm" blah blah \n'
+ 'href = "http://www.foo.com.faa/daa.asp" dooo daah';
reg = /http[^"]+(asp¦[s]?htm[l]?¦xml)"/g
matches = str.match(reg)
alert(matches) // remove trailing quotemark yourself
}
</script>
G.
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
function narrow2() {
<!--
str = document.getElementById('txt').value;
reg = /http[^"]+(asp¦[s]?htm[l]?¦xml)"/g
matches = str.match(reg)
// -->
}
</script>
</head>
<body>
<form>
<textarea id="txt" cols=140 rows=10 name="txt">
[google.com...]
[essex.ac.uk...]
[translate.google.com...]
</textarea>
<input type="button" onclick="narrow2()">
</form>
</body>
</html>
JL