tags:

views:

153

answers:

1

Hey again i asked a question the other day about removing html tags with regular expressions.

Well now i am wondering is there any way to use this on regular expression but add to it? So that it could also remove links beggining with http and ending with .stm or .gif?

This is the piece of code im using:

string BBCSplit = Regex.Replace(BBC, @"<(.|\n)*?>", string.Empty);

Thanks,

Ash

+2  A: 

The best way to figure out regular expressions is through example, trial and error.

Put your html text in this site, along with your regexp and if it turns yellow, it's matched.

If you need a tutorial on how regexp works, I found this site to be very useful.

The regexp you'll want will be something like http:.*\.stm - which means "the characters http, followed by 0 or more characters (.*) followed by the characters .stm".

gbjbaanb