anorakgirl
Programmer
hi,
i'm trying to write an asp driven search engine, and to get the keywords for the page, i'm uing regular expressions to strip out html tags etc.
i'm using the following to strip out html tags:
which works fine but obviously this leaves the bits between the html tags, which means if there is a
section in the page, the blah blah gets left in.
i tried doing something like this before stripping the html tags:
but it doesn't seem to work. i'm guessing its something to do with carriage returns or < characters or something within the javascript (ie the blah blah) but i'm not a regular expression expert - anyone give me a clue why this isn't working?
thank you! ~ ~
i'm trying to write an asp driven search engine, and to get the keywords for the page, i'm uing regular expressions to strip out html tags etc.
i'm using the following to strip out html tags:
Code:
var reg = /<[^>]*>/ig;
strKeywords = strKeywords.replace(reg,"");
Code:
<script language="javascript">
blah blah
</script>
i tried doing something like this before stripping the html tags:
Code:
reg = /<script[^>]*>[.|\s|\n]*<\/script>/ig;
strKeywords = strKeywords.replace(reg,"");
thank you! ~ ~