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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top