Solved

check the html tag

Posted on 2004-08-30
4
211 Views
Last Modified: 2013-12-25
I want to check a string that is there a html tag in it.
How can i do for it?
0
Comment
Question by:aresdeng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 11938766
What language?

Let's assume Perl.

Here's a not so robust way of checking:

$string = 'some text with a <tag> in it';

print "String may contain a HTML tag\n" if ($string =~ /<.*>/);

If you want to check for valid HTML tags or tags that are split across lines, things get a little more complicated.
0
 

Author Comment

by:aresdeng
ID: 11938896
Thank you.

I want to check for valid HTML tags.
How can i do?
0
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 11938933
0
 

Author Comment

by:aresdeng
ID: 11939209

thank you.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question