I want a regular expression that can match
<FONT FACE=\"Verdana\" SIZE=\"12\"> My Name is xyz </FONT> or
<LI><FONT FACE=\"Verdana\" SIZE=\"12\"> My Name is xyz </FONT></LI> and it should not be greedy
Three questions in as many hours. Must be a record of some sorts.
For the sake of humanity, don't use regular expressions to parse XML!
Why not use a Java XML parser?
the beginning of the answer to this exact question with over 4300 up votes. If you don't understand this and insist on ignoring this advice then you probably should not be programming.
What happens when FACE and SIZE are in opposite order?
.*will match those 2 strings completely. And many other strings as well. If you don't want to match the other strings, then say what those strings are. It always helps to be specific in saying what you want to match and what you don't want to match in regex questions.