regex help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tem

    regex help

    im looking for a regex that removes html special characters
    such at  

    & followed by a word then ;


    Tem
  • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

    #2
    Re: regex help

    Tem wrote:
    im looking for a regex that removes html special characters
    such at  
    >
    & followed by a word then ;
    Remove is easy.

    s = Regex.Replace(s , "&[^;]+;", "");

    should do that.

    You can get the meaning of the entity inserted with:

    s = HttpUtility.Htm lDecode(s);

    Arne

    Comment

    • Tem

      #3
      Re: regex help

      WOW
      this solves all my problems


      "Arne Vajhøj" <arne@vajhoej.d kwrote in message
      news:48475205$0 $90273$14726298 @news.sunsite.d k...
      Tem wrote:
      >im looking for a regex that removes html special characters
      >such at &nbsp;
      >>
      >& followed by a word then ;
      >
      Remove is easy.
      >
      s = Regex.Replace(s , "&[^;]+;", "");
      >
      should do that.
      >
      You can get the meaning of the entity inserted with:
      >
      s = HttpUtility.Htm lDecode(s);
      >
      Arne
      >

      Comment

      • =?Utf-8?B?anAybXNmdA==?=

        #4
        Re: regex help

        Or you could put this in your page directive… validaterequest ="true”

        "Arne Vajhøj" wrote:
        Tem wrote:
        im looking for a regex that removes html special characters
        such at

        & followed by a word then ;
        >
        Remove is easy.
        >
        s = Regex.Replace(s , "&[^;]+;", "");
        >
        should do that.
        >
        You can get the meaning of the entity inserted with:
        >
        s = HttpUtility.Htm lDecode(s);
        >
        Arne
        >
        >

        Comment

        Working...