Aisha Srivastava

Aisha Srivastava

  • 1.9k
  • 230
  • 24.4k

Regex in C#

May 27 2015 7:05 AM
Want to replace the size attribute with corresponding value.
i.e
we have <FONT style="BACKGROUND-COLOR: #ffffff" size=4 face="Urdu Typesetting"> this html or strin 
In this we have  to replace size=12pt and put it back in the string at same place<FONT style="BACKGROUND-COLOR: #ffffff" size=12pt face="Urdu Typesetting">.
 We have to cope up pattern with all the condition style  and face attribute may be absent and can be any one of them and arrangement may be diffrent
we have to make pattern which full fill all the pattern. 
i.e <FONT size=4> ----> <FONT size=12pt>
i.e<FONT style="BACKGROUND-COLOR: #ffffff" size=4> ---><FONT style="BACKGROUND-COLOR: #ffffff" size=12pt>
i.e<FONT style="BACKGROUND-COLOR: #ffffff" face="Urdu Typesetting"size=4>  -----><FONT style="BACKGROUND-COLOR: #ffffff" face="Urdu Typesetting"size=12pt>
so on. 
//1:6pt
// 2:8pt
// 3:10pt
// 4:12pt
// 5:14pt
// 6:16pt
// 7:18pt
 

Answers (7)