check the html tag

I want to check a string that is there a html tag in it.
How can i do for it?
aresdengAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TintinCommented:
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
 
aresdengAuthor Commented:
Thank you.

I want to check for valid HTML tags.
How can i do?
0
 
aresdengAuthor Commented:

thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.