Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bambe 45 posts 66 karma points
    Apr 08, 2011 @ 05:51
    Bambe
    0

    using regular expression to search any html tag and replace

    Hi all

    I want the @bodyText all about html tags to using Exslt.ExsltRegularExpressions:replace

    to replace all html tags

    e.g. <p> asdfa<strong>sdfa</strong>sdf</p> <ul><li>abcd</li><li>1234></li><ul>

    to: asdfasdfasdfabcd1234

    how shoutld I to order regexp?

    and how about Exslt.ExsltRegularExpressions:replace third column flags?

    thx alot :)

     

    Regards,

    Bambe :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 08, 2011 @ 08:23
    Jan Skovgaard
    0

    Hi Bambe

    Is there any specific reason why you want to do it with replace?

    I think the StripHtml extension from the umbraco.library is just what you need in this case - have a look at it here http://our.umbraco.org/wiki/reference/umbracolibrary/striphtml

    It does what it says...strips the HTML leaving you with the text only :-)

    Hope this helps.

    /Jan

  • Bambe 45 posts 66 karma points
    Apr 08, 2011 @ 10:23
    Bambe
    0

    Hi Jan,

    That's what I need, thx a lot :)

     

    Regards,

    Bambe :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 08, 2011 @ 20:09
    Jan Skovgaard
    0

    Hi Bambe

    Good to hear. Sometimes it's hard to figure out the most simple solutions :-)

    Have a nice weekend.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft