# Filter HTML contents of a sql query

**URL:** <https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961>\
**Category:** Network\
**Created:** [January 17, 2013, 1:38am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961 "2013-01-17T01:38:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvagdas](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@bvagdas](https://forums.solar2d.com/u/bvagdas)\
**Post date:** [January 17, 2013, 1:38am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/1 "2013-01-17T01:38:02Z")

</div>

hello,

can anyone tell me if can i filter html tags from a text , which i get from a sql query.  
Does lua have anything like that??

please help guys!  
Thanks! [import]uid: 185094 topic\_id: 35036 reply\_id: 335036[/import]

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 17, 2013, 11:01am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/2 "2013-01-17T11:01:48Z")

</div>

Hello,  
Do you mean searching a text string for HTML tags and removing them? You could accomplish that with string matching/replace, i.e. string.gsub().

[http://docs.coronalabs.com/api/library/string/gsub.html](http://docs.coronalabs.com/api/library/string/gsub.html)

Brent [import]uid: 200026 topic\_id: 35036 reply\_id: 139356[/import]

---

<div class="post-metadata">

**Author:** ![bvagdas](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@bvagdas](https://forums.solar2d.com/u/bvagdas)\
**Post date:** [January 17, 2013, 11:49pm UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/3 "2013-01-17T23:49:51Z")

</div>

exactly brent… i used SQL REPLACE function instead… i think is a similar way for achieving that. i wonder if there is a function for removing the html automaticaly… that would be nice… [import]uid: 185094 topic\_id: 35036 reply\_id: 139436[/import]

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 18, 2013, 10:56am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/4 "2013-01-18T10:56:24Z")

</div>

Hi @bvagdas,  
If you write a simple filtering routine for this, can you please post it in the Code Share? I’d think it should be fairly easy, if you’re talking about just getting rid of standard HTML tags enclosed in \<\> hashes. Getting rid of special characters like "&nbsp;" would probably be simple too.

Brent [import]uid: 200026 topic\_id: 35036 reply\_id: 139503[/import]

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 17, 2013, 11:01am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/5 "2013-01-17T11:01:48Z")

</div>

Hello,  
Do you mean searching a text string for HTML tags and removing them? You could accomplish that with string matching/replace, i.e. string.gsub().

[http://docs.coronalabs.com/api/library/string/gsub.html](http://docs.coronalabs.com/api/library/string/gsub.html)

Brent [import]uid: 200026 topic\_id: 35036 reply\_id: 139356[/import]

---

<div class="post-metadata">

**Author:** ![bvagdas](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/97f17d/32.png) [@bvagdas](https://forums.solar2d.com/u/bvagdas)\
**Post date:** [January 17, 2013, 11:49pm UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/6 "2013-01-17T23:49:51Z")

</div>

exactly brent… i used SQL REPLACE function instead… i think is a similar way for achieving that. i wonder if there is a function for removing the html automaticaly… that would be nice… [import]uid: 185094 topic\_id: 35036 reply\_id: 139436[/import]

---

<div class="post-metadata">

**Author:** ![bjsorrentino](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@bjsorrentino](https://forums.solar2d.com/u/bjsorrentino)\
**Post date:** [January 18, 2013, 10:56am UTC](https://forums.solar2d.com/t/filter-html-contents-of-a-sql-query/309961/7 "2013-01-18T10:56:24Z")

</div>

Hi @bvagdas,  
If you write a simple filtering routine for this, can you please post it in the Code Share? I’d think it should be fairly easy, if you’re talking about just getting rid of standard HTML tags enclosed in \<\> hashes. Getting rid of special characters like "&nbsp;" would probably be simple too.

Brent [import]uid: 200026 topic\_id: 35036 reply\_id: 139503[/import]
