regex help

  • Thread starter Thread starter Tem
  • Start date Start date
T

Tem

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

& followed by a word then ;


Tem
 
Tem said:
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.HtmlDecode(s);

Arne
 
WOW
this solves all my problems


Arne Vajhøj said:
Tem said:
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.HtmlDecode(s);

Arne
 
Or you could put this in your page directive… validaterequest="trueâ€

Arne Vajhøj said:
Tem said:
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.HtmlDecode(s);

Arne
 
Back
Top