check the html tag

I want to check a string that is there a html tag in it.
How can i do for it?
Who is Participating?
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.
aresdengAuthor Commented:
Thank you.

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

thank you.
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.