 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Strip Tags HTML</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 07:13:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: kccrosser</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-77255</link>
		<dc:creator>kccrosser</dc:creator>
		<pubDate>Tue, 18 May 2010 18:54:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-77255</guid>
		<description><![CDATA[sOut = REPLACE(sIn, ‘&lt;b&gt;’, ”)
Here is the corrected sequence:

&lt;pre&gt;sOut = REPLACE(sOut, ‘&lt;/b&gt;’, ”)
sOut = REPLACE(sOut, ‘&lt;’, ‘&lt;’)
sOut = REPLACE(sOut, &#039;&gt;’, ‘&gt;’)
sOut = REPLACE(sOut, ‘&quot;’, ‘”‘)
sOut = REPLACE(sOut, ‘&apos;’, ””)
sOut = REPLACE(sOut, ‘&amp;’, ‘&amp;’)&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>sOut = REPLACE(sIn, ‘&lt;b&gt;’, ”)<br />
Here is the corrected sequence:</p>
<pre>sOut = REPLACE(sOut, ‘&lt;/b&gt;’, ”)
sOut = REPLACE(sOut, ‘&amp;lt;’, ‘&lt;’)
sOut = REPLACE(sOut, '&amp;gt;’, ‘&gt;’)
sOut = REPLACE(sOut, ‘&amp;quot;’, ‘”‘)
sOut = REPLACE(sOut, ‘&amp;apos;’, ””)
sOut = REPLACE(sOut, ‘&amp;amp;’, ‘&amp;’)</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: kccrosser</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-77254</link>
		<dc:creator>kccrosser</dc:creator>
		<pubDate>Tue, 18 May 2010 18:51:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-77254</guid>
		<description><![CDATA[Ok, duh, I forgot to escape the entity tags in my code above, so my examples got converted from the entity representations down to the text characters.

Obviously, the first arguments in the replace should be the actual text strings of the entity values - e.g., for the ampersand, the string would be &quot;(ampersand)amp;&quot;.
One of the following should display correctly:
&lt;pre&gt;sOut = REPLACE ( sIn, &#039;&amp;&#039;, &#039;&amp;&#039; )
sOut = REPLACE( sIn, &#039;&amp;&#039;, &#039;&amp;&#039; )&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Ok, duh, I forgot to escape the entity tags in my code above, so my examples got converted from the entity representations down to the text characters.</p>
<p>Obviously, the first arguments in the replace should be the actual text strings of the entity values &#8211; e.g., for the ampersand, the string would be &#8220;(ampersand)amp;&#8221;.<br />
One of the following should display correctly:</p>
<pre>sOut = REPLACE ( sIn, '&amp;amp;', '&amp;' )
sOut = REPLACE( sIn, '&amp;', '&amp;' )</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: kccrosser</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-77252</link>
		<dc:creator>kccrosser</dc:creator>
		<pubDate>Tue, 18 May 2010 18:46:08 +0000</pubDate>
		<guid isPermaLink="false">#comment-77252</guid>
		<description><![CDATA[How complicated do you need to make this?

If you are only concerned with converting the five standard &quot;entities&quot; (ampersand, apostrophe, quote, less than, greater than), and the basic formatting (bold, italic, underline), you can do that by repeated application of the simple REPLACE expression.

sOut = REPLACE(sIn, &#039;&lt;b&gt;&#039;, &#039;&#039;)
sOut = REPLACE(sOut, &#039;&lt;/b&gt;&#039;, &#039;&#039;)
sOut = REPLACE(sOut, &#039;&lt;&#039;, &#039;&lt;&#039;)
sOut = REPLACE(sOut, &#039;&gt;&#039;, &#039;&gt;&#039;)
sOut = REPLACE(sOut, &#039;&quot;&#039;, &#039;&quot;&#039;)
sOut = REPLACE(sOut, &#039;&apos;&#039;, &#039;&#039;&#039;&#039;)
sOut = REPLACE(sOut, &#039;&amp;&#039;, &#039;&amp;&#039;)
...

Of course, you can concatenate these:

sOut = REPLACE(REPLACE(REPLACE(sIn, &#039;&lt;b&gt;&#039;, &#039;&#039;), &#039;&lt;/b&gt;&#039;, &#039;&#039;), &#039;&quot;&#039;, &#039;&quot;&#039;)

I would write a simple PL/SQL function that applied these rather than using the REPLACE multiple times in line.

Note that to avoid side-effects, I would apply them in a specific order - formatting first (&lt;b&gt;, &lt;i&gt;, etc.), and then the entities, ending with the substitution for the ampersand itself.  Otherwise, you have a (slight) risk of generating a false entity or formatting string in the interim results, which could change your data contents.

If you need to remove more complex structures, then you would need to resort to actually parsing the text.]]></description>
		<content:encoded><![CDATA[<p>How complicated do you need to make this?</p>
<p>If you are only concerned with converting the five standard &#8220;entities&#8221; (ampersand, apostrophe, quote, less than, greater than), and the basic formatting (bold, italic, underline), you can do that by repeated application of the simple REPLACE expression.</p>
<p>sOut = REPLACE(sIn, &#8216;&lt;b&gt;&#8217;, &#8221;)<br />
sOut = REPLACE(sOut, &#8216;&lt;/b&gt;&#8217;, &#8221;)<br />
sOut = REPLACE(sOut, &#8216;&lt;&#8217;, &#8216;&lt;&#8217;)<br />
sOut = REPLACE(sOut, &#8216;&gt;&#8217;, &#8216;&gt;&#8217;)<br />
sOut = REPLACE(sOut, &#8216;&quot;&#8217;, &#8216;&#8221;&#8216;)<br />
sOut = REPLACE(sOut, &#8216;&apos;&#8217;, &#8221;&#8221;)<br />
sOut = REPLACE(sOut, &#8216;&amp;&#8217;, &#8216;&amp;&#8217;)<br />
&#8230;</p>
<p>Of course, you can concatenate these:</p>
<p>sOut = REPLACE(REPLACE(REPLACE(sIn, &#8216;&lt;b&gt;&#8217;, &#8221;), &#8216;&lt;/b&gt;&#8217;, &#8221;), &#8216;&quot;&#8217;, &#8216;&#8221;&#8216;)</p>
<p>I would write a simple PL/SQL function that applied these rather than using the REPLACE multiple times in line.</p>
<p>Note that to avoid side-effects, I would apply them in a specific order &#8211; formatting first (&lt;b&gt;, &lt;i&gt;, etc.), and then the entities, ending with the substitution for the ampersand itself.  Otherwise, you have a (slight) risk of generating a false entity or formatting string in the interim results, which could change your data contents.</p>
<p>If you need to remove more complex structures, then you would need to resort to actually parsing the text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vakilabhay</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-77229</link>
		<dc:creator>vakilabhay</dc:creator>
		<pubDate>Tue, 18 May 2010 08:09:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-77229</guid>
		<description><![CDATA[sir it&#039;s very helpful but 
one problem is that when we store the data like  following 
&#039;&lt;b&gt;india&lt;/b&gt;&amp;copy&#039; in database 
(&amp;copy is for special character )
that time how we can remove the html tags  from data 
if this function is use or file like that
select REGEXP_REPLACE (&#039;&lt;b&gt;india&lt;/b&gt;&amp;copy&#039;) from dual;
it ask for bind variable. how to resolve it. it&#039;s urgent please.]]></description>
		<content:encoded><![CDATA[<p>sir it&#8217;s very helpful but<br />
one problem is that when we store the data like  following<br />
&#8216;&lt;b&gt;india&lt;/b&gt;&amp;copy&#8217; in database<br />
(&amp;copy is for special character )<br />
that time how we can remove the html tags  from data<br />
if this function is use or file like that<br />
select REGEXP_REPLACE (&#8216;&lt;b&gt;india&lt;/b&gt;&amp;copy&#8217;) from dual;<br />
it ask for bind variable. how to resolve it. it&#8217;s urgent please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: frankkulash</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-51705</link>
		<dc:creator>frankkulash</dc:creator>
		<pubDate>Wed, 20 Feb 2008 21:38:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-51705</guid>
		<description><![CDATA[Hi,

I don&#039;t know any good way to do what you want in pure SQL.  I&#039;d use a PL/SQL function, such as replace_between (see end of this message).

I&#039;m not familiar with Oracle Text, so I don&#039;t know how this can be used with it.  You may have to create a column containing (or an index on) &quot;replace_between (camp1, &#039;&lt;&#039;, &#039;&gt;&#039;)&quot; in addition to (or instead of) the column containing (or index on) camp1 in order to use CONTAINS.

Here&#039;s the replace_between function:

&lt;pre&gt;
--		***************************************
--		**   r e p l a c e _ b e t w e e n   **
--		***************************************

--	replace between returns a copy of in_txt with all substrings that begin with
--	in_begin_txt and end with in_end_txt replaced by in_new_txt.
--	in_begin_txt nd in_end_txt do NOT have to be distinct. 
--	If in_begin_txt is not followed by in_end_txt, the value returned does not
--	include anything after it.
--	Examples:
--						in_	in_e
--						begin_	end_	new_
--	in_txt					txt	txt	txt	value returned
--	&lt;html&gt;The &lt;b&gt;Quick&lt;/b&gt; brown&lt;/html&gt;	&lt;	&gt;	&lt;tag&gt;	&lt;tag&gt;The &lt;tag&gt;Quick&lt;tag&gt; brown&lt;tag&gt;
--	fox [ jumps [ over ) the [lazy dog 	[	)	*	fox * the *
--	abracadabra				a	a	a	acar
--	a&lt;/p&gt;b&lt;p&gt;inside&lt;/p&gt;unbalanced&lt;/p&gt;	&lt;p&gt;	&lt;/p&gt;	NULL	a&lt;/p&gt;bunbalanced&lt;/p&gt;

FUNCTION	replace_between
(	in_txt		IN	VARCHAR2			-- string to be altered
,	in_begin_txt	IN	VARCHAR2			-- beginning of sub-string to be replaced
,	in_end_txt	IN	VARCHAR2			-- end of sub-string to be replaced
,	in_new_txt	IN	VARCHAR2	DEFAULT NULL	-- replacement string
)
RETURN	VARCHAR2
DETERMINISTIC
IS
	begin_len	PLS_INTEGER	:= LENGTH (in_begin_txt);
	begin_pos	PLS_INTEGER	:= INSTR (in_txt, in_begin_txt);
	end_len		PLS_INTEGER	:= LENGTH (in_end_txt);
	end_pos		PLS_INTEGER;
	j		PLS_INTEGER	:= 0;
	new_len		PLS_INTEGER	:= length0 (in_new_txt); 
	return_txt	VARCHAR2 (4000)	:= in_txt;
BEGIN
	WHILE	begin_pos &gt; 0
	LOOP
		end_pos := INSTR	( return_txt
					, in_end_txt
					, begin_pos + begin_len
					);
		IF  end_pos &gt; 0
		AND j &lt; 10
		THEN	-- end_txt found
			return_txt := SUBSTR (return_txt, 1, begin_pos - 1)
				&#124;&#124; in_new_txt
				&#124;&#124; SUBSTR (return_txt, end_pos + end_len);
			begin_pos := INSTR	( return_txt
						, in_begin_txt
						, begin_pos + new_len + 1
						);
		ELSE	-- end_txt not found
			return_txt := SUBSTR (return_txt, 1, begin_pos - 1)
				&#124;&#124; in_new_txt;
			begin_pos := 0;
		END IF;
		j := j + 1;
	END LOOP;

	RETURN	return_txt;
END	replace_between
;
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I don&#8217;t know any good way to do what you want in pure SQL.  I&#8217;d use a PL/SQL function, such as replace_between (see end of this message).</p>
<p>I&#8217;m not familiar with Oracle Text, so I don&#8217;t know how this can be used with it.  You may have to create a column containing (or an index on) &#8220;replace_between (camp1, &#8216;&lt;&#8217;, &#8216;&gt;&#8217;)&#8221; in addition to (or instead of) the column containing (or index on) camp1 in order to use CONTAINS.</p>
<p>Here&#8217;s the replace_between function:</p>
<pre>
--		***************************************
--		**   r e p l a c e _ b e t w e e n   **
--		***************************************

--	replace between returns a copy of in_txt with all substrings that begin with
--	in_begin_txt and end with in_end_txt replaced by in_new_txt.
--	in_begin_txt nd in_end_txt do NOT have to be distinct. 
--	If in_begin_txt is not followed by in_end_txt, the value returned does not
--	include anything after it.
--	Examples:
--						in_	in_e
--						begin_	end_	new_
--	in_txt					txt	txt	txt	value returned
--	&lt;html&gt;The &lt;b&gt;Quick&lt;/b&gt; brown&lt;/html&gt;	&lt;	&gt;	&lt;tag&gt;	&lt;tag&gt;The &lt;tag&gt;Quick&lt;tag&gt; brown&lt;tag&gt;
--	fox [ jumps [ over ) the [lazy dog 	[	)	*	fox * the *
--	abracadabra				a	a	a	acar
--	a&lt;/p&gt;b&lt;p&gt;inside&lt;/p&gt;unbalanced&lt;/p&gt;	&lt;p&gt;	&lt;/p&gt;	NULL	a&lt;/p&gt;bunbalanced&lt;/p&gt;

FUNCTION	replace_between
(	in_txt		IN	VARCHAR2			-- string to be altered
,	in_begin_txt	IN	VARCHAR2			-- beginning of sub-string to be replaced
,	in_end_txt	IN	VARCHAR2			-- end of sub-string to be replaced
,	in_new_txt	IN	VARCHAR2	DEFAULT NULL	-- replacement string
)
RETURN	VARCHAR2
DETERMINISTIC
IS
	begin_len	PLS_INTEGER	:= LENGTH (in_begin_txt);
	begin_pos	PLS_INTEGER	:= INSTR (in_txt, in_begin_txt);
	end_len		PLS_INTEGER	:= LENGTH (in_end_txt);
	end_pos		PLS_INTEGER;
	j		PLS_INTEGER	:= 0;
	new_len		PLS_INTEGER	:= length0 (in_new_txt); 
	return_txt	VARCHAR2 (4000)	:= in_txt;
BEGIN
	WHILE	begin_pos &gt; 0
	LOOP
		end_pos := INSTR	( return_txt
					, in_end_txt
					, begin_pos + begin_len
					);
		IF  end_pos &gt; 0
		AND j &lt; 10
		THEN	-- end_txt found
			return_txt := SUBSTR (return_txt, 1, begin_pos - 1)
				|| in_new_txt
				|| SUBSTR (return_txt, end_pos + end_len);
			begin_pos := INSTR	( return_txt
						, in_begin_txt
						, begin_pos + new_len + 1
						);
		ELSE	-- end_txt not found
			return_txt := SUBSTR (return_txt, 1, begin_pos - 1)
				|| in_new_txt;
			begin_pos := 0;
		END IF;
		j := j + 1;
	END LOOP;

	RETURN	return_txt;
END	replace_between
;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: ged</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-51689</link>
		<dc:creator>ged</dc:creator>
		<pubDate>Wed, 20 Feb 2008 13:57:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-51689</guid>
		<description><![CDATA[Sorry. Had not said that use Oracle 9i, and REGEXP_REPLACE is only available on Oracle 10, I think. 
My Select is:
Select x from n where  ((CONTAINS (camp1, &#039; &quot;+ text +&quot;&#039;)&gt; 0)) 

And I need to modify it to ignore html tags that contain camp1 to find &quot;text&quot;.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Sorry. Had not said that use Oracle 9i, and REGEXP_REPLACE is only available on Oracle 10, I think.<br />
My Select is:<br />
Select x from n where  ((CONTAINS (camp1, &#8216; &#8220;+ text +&#8221;&#8216;)&gt; 0)) </p>
<p>And I need to modify it to ignore html tags that contain camp1 to find &#8220;text&#8221;.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ged</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/strip-tags-html/#comment-51688</link>
		<dc:creator>ged</dc:creator>
		<pubDate>Wed, 20 Feb 2008 13:57:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-51688</guid>
		<description><![CDATA[Sorry. Had not said that use Oracle 9i, and REGEXP_REPLACE is only available on Oracle 10, I think. 
My Select is:
Select x from n where  ((CONTAINS (camp1, &#039; &quot;+ text +&quot;&#039;)&gt; 0)) 

And I need to modify it to ignore html tags that contain camp1 to find &quot;text&quot;.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Sorry. Had not said that use Oracle 9i, and REGEXP_REPLACE is only available on Oracle 10, I think.<br />
My Select is:<br />
Select x from n where  ((CONTAINS (camp1, &#8216; &#8220;+ text +&#8221;&#8216;)&gt; 0)) </p>
<p>And I need to modify it to ignore html tags that contain camp1 to find &#8220;text&#8221;.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 5/8 queries in 0.021 seconds using memcached
Object Caching 353/354 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 08:08:54 -->