I have a regular expression I’m using to remove html tags and now I’m wondering if there is any way to modify it so that it could also remove links beginning with http and ending with .stm or .gif?
This is the piece of code I’m using:
string BBCSplit = Regex.Replace(BBC, @'<(.|\n)*?>', string.Empty);
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’.