Search Results

Search found 2 results on 1 pages for 'chapmanio'.

Page 1/1 | 1 

  • Regular expression to convert ul to textindent and back, with a different attribute value for first

    - by chapmanio
    Hi, This is a related to a previous question I have asked here, see the link below for a brief description as to why I am trying to do this. Regular expression from font to span (size and colour) and back (VB.NET) Basically I need a regex replace function (or if this can be done in pure VB then that's fine) to convert all ul tags in a string to textindent tags, with a different attribute value for the first textindent tag. For example: <ul> <li>This is some text</li> <li>This is some more text</li> <li> <ul> <li>This is some indented text</li> <li>This is some more text</li> </ul> </li> <li>More text!</li> <li> <ul> <li>This is some indented text</li> <li>This is some more text</li> </ul> </li> <li>More text!</li> </ul> Will become: <textformat indent="0"> <li>This is some text</li> <li>This is some more text</li> <li> <textformat indent="20"> <li>This is some indented text</li> <li>This is some more text</li> </textformat> </li> <li>More text!</li> <li> <textformat indent="20"> <li>This is some indented text</li> <li>This is some more text</li> </textformat> </li> <li>More text!</li> </textformat> Basically I want the first ul tag to have no indenting, but all nested ul tags to have an indent of 20. I appreciate this is a strange request but hopefully that makes sense, please let me know if you have any questions. Thanks in advance.

    Read the article

  • Regular expression from font to span (size and colour) and back (VB.NET)

    - by chapmanio
    Hi, I am looking for a regular expression that can convert my font tags (only with size and colour attributes) into span tags with the relevant inline css. This will be done in VB.NET if that helps at all. I also need a regular expression to go the other way as well. To elaborate below is an example of the conversion I am looking for: <font size="10">some text</font> To then become: <span style="font-size:10px;">some text</span> So converting the tag and putting a "px" at the end of whatever the font size is (I don't need to change/convert the font size, just stick px at the end). The regular expression needs to cope with a font tag that only has a size attribute, only a color attribute, or both: <font size="10">some text</font> <font color="#000000">some text</font> <font size="10" color="#000000">some text</font> <font color="#000000" size="10">some text</font> I also need another regular expression to do the opposite conversion. So for example: <span style="font-size:10px;">some text</span> Will become: <font size="10">some text</font> As before converting the tag but this time removing the "px", I don't need to worry about changing the font size. Again this will also need to cope with the size styling, font styling, and a combination of both: <span style="font-size:10px;">some text</span> <span style="color:#000000;">some text</span> <span style="font-size:10px; color:#000000;">some text</span> <span style="color:#000000; font-size:10px;">some text</span> I apprecitate this is a lot to ask, I am hopeless with regular expressions and need to find a way of making these conversions in my code. Thanks so much to anyone that can/is willing to help me!

    Read the article

1