Asp tutorial. net how to filter all html tags
Public static string nohtml (string htmlstring)
{
// Delete the script
Htmlstring = regex. replace (htmlstring, @ " ","",
Regexoptions. ignorecase );
// Delete html
Htmlstring = regex. replace
Php filters all html tags. First, we recommend that the filter_sanitize_string and filter_sanitize_string filters remove or encode unnecessary characters. This filter deletes data that is potentially harmful to the application. First, we recommend
In recent days when doing projects, often on the page to process some data. The result found oneself JS Master is not very good. It is here to record the bit of JS drip it.1. Removing HTML tags from a stringfunction Delhtmltag (str) { return
ASP tutorial. NET filters all HTML tags in several ways
public static string nohtml (String htmlstring)
{
Delete Script
htmlstring = Regex.Replace (htmlstring, @ "", "",
Regexoptions.ignorecase);
Delete HTML
htmlstring = Regex.Replace
Only to the novice, the predecessors do not come to see me move the door to get axe. Hehe
Often see a novice to ask such a topic, in fact, on the regular expression I do not understand.
Yesterday afternoon looked at Microsoft's regular expression, a
such as a piece of code:
Software map, software Test 1 try Hello a Test 4 test b
Match: (Test \d test)
So the match I want is
Test 1 Test
Test 3 Test
Instead of matching "Test 2" and "Test 4" included in HTML tags
[Ctrl +
For example, a piece of code:Software map, software Test 1 test Hello ASDASD Test 3 test a Test 4 Test B Matching: (test \ d)So what I want to match isTest 1Test 3But does not match the "Test 2" and "Test 4" contained in the html Tag" [Ctrl + A
No matter what language you use, the regular expression processing method is very flexible and efficient, especially for the capture and filtering of some strings, it is more advantageous.
Regular Expressions are generally easy to write, with
I wrote a regular expression,
This is a replacement of HTML tags, non-greedy, multi-line.
If I want to replace it with a non-HTML tag,
This is the only way for my code to do this. First, find the HTML Tag and replace the tag.
Can I find a
First we recommend filter_sanitize_string, filter_sanitize_string filter to remove or encode unwanted characters.
This filter deletes data that is potentially harmful to the application. It is used to remove labels and to delete or encode unwanted
I wrote a regular expression,
This is the replacement so HTML tags, not greedy, multiline.
If I want to replace it so non-HTML tags,
That's all my code can do, first find the HTML tag and replace the tag.
Can you find a non-HTML tag directly?
For example
Code :
Software map, software Test 1 test Hello asdasd Test 3 test A Test 4 Test B
Matching: (test \ D)
So what I want to match is
Test 1
Test 3
But does not match the "Test 2" and "Test 4" contained in the HTML
First, we recommend that the filter_sanitize_string and filter_sanitize_string filters remove or encode unnecessary characters.
This filter deletes data that is potentially harmful to the application. It is used to remove tags and delete or encode
HTML markup
Only to the novice, the predecessors do not come to see me move the door to get axe. HeheOften see a novice to ask such a topic, in fact, on the regular expression I do not understand.Yesterday afternoon looked at Microsoft's regular
First we recommend filter_sanitize_string, filter_sanitize_string filters to remove or encode unwanted characters. This filter removes data that is potentially harmful to the application. It is used to remove tags and remove or encode unwanted
PHP Development Note Series (ii)-string usage
After the "PHP Development Note Series (a)-pdo use", today opened a PHP development in the processing of strings, "PHP Development Note Series (ii)-string use", the formation of the "PHP Development
PHP Development notes series (II)-string usage & nbsp; after the PHP Development notes series (I) -PDO usage: Today, we have introduced how to process strings in PHP Development. PHP Development notes series (II)-string usage. form the PHP
Function code used by php to filter html tags. Php function code for filtering html tags this article provides four function codes for filtering html tags using php, method 1 uses the strip_tags function provided by php to filter all html tags.
PHP Development notes series (II)-string usage & nbsp; after the PHP Development notes series (I) -PDO usage: Today, we opened the PHP Development notes series (II)-string usage, which is the second article in the PHP Development notes series. &
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.