what is regular expression for a either a valid html or no html?

Question by Ron M: what is regular expression for a either a valid html or no html?
I am using asp.net and c# , I want value in a text box should be either a valid html ( full or partial html ) or no html
yes , I am trying to use regular expression validator, what is “ans” Is it a regular expression you are suggesting ?

two problem :
1) I have regular expression for html :
(<\/?)(?i:(?a(bbr|cronym|ddress|pplet|rea)?|b(ase(font)?|do|ig|lockquote|ody|r|utton)?|c(aption|enter|ite|(o(de|l(group)?)))|d(d|el|fn|i(r|v)|l|t)|em|f(ieldset|o(nt|rm)|rame(set)?)|h([1-6]|ead|r|tml)|i(frame|mg|n(put|s)|sindex)?|kbd|l(abel|egend|i(nk)?)|m(ap|e(nu|ta))|no(frames|script)|o(bject|l|pt(group|ion))|p(aram|re)?|q|s(amp|cript|elect|mall|pan|t(r(ike|ong)|yle)|u(b|p))|t(able|body|d|extarea|foot|h|itle|r|t)|u(l)?|var))(\s(?.+?))*>
which is a full html validator , I want a partial html validator . for example
a) ”

testing

” , should be valid string

but
b) “

” should not be valid string because “Best answer:

Answer by Ruchi
r u using a regularexpression validator? then may be ans should be the value.. try kijiye

Know better? Leave your own answer in the comments!

Revisions

There are no revisions for this post.

Tags: , , , ,

One Response to “what is regular expression for a either a valid html or no html?”

  1. Konrad July 18, 2011 at 8:50 PM #

    It’s impossible to check if a part of the text repeats later in the text with regexps.

Leave a Reply

 

testing