0

I have this code:

<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT SIZE="9" COLOR="#2C363D" LETTERSPACING="0" KERNING="0">A draft Ad for YAPAR_3743-Tv2 has been produced and is ready for your review and approval. </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT SIZE="9" COLOR="#2C363D" LETTERSPACING="0" KERNING="0"> </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT SIZE="9" COLOR="#2C363D" LETTERSPACING="0" KERNING="0">Thank You, </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT SIZE="9" COLOR="#2C363D" LETTERSPACING="0" KERNING="0">LoremIpsumDolorSitAmetConsecteturAdipiscingElitNullamEgetMaurisQuam EnergisticallyUnleashProactiveIdeasWhereasHigh-PayoffTechnologies</FONT></P></TEXTFORMAT>

I need to get all size attributes with value, for example SIZE="9".

Radislav
  • 2,892
  • 7
  • 38
  • 61
  • 1
    http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags – pcalcao Mar 23 '12 at 10:46

1 Answers1

1

Use simply this expression:

(SIZE="\d+")

If you need to also accept units, like px or %:

(SIZE="\d+(px|%)?")

Accept extra spaces in between the =

(SIZE\s*=\s*"\d+(px|%)?")

Take also into account if there are upper and lower cases (run the regex wtih case insensitive option).

JotaBe
  • 38,030
  • 8
  • 98
  • 117