I'm looking for a way to use regexp in order to remove all html tags from a string.
So if I have <HTML><b><FONT color="red" size="3">Hello</FONT></b></HTML>
I would like to get the hello
from it.
I know it will probably look like nested tags, but it's not really, because all I want to do here is to remove anything between two <>
.
I'm using Matlab for doing so, but the regexp is the exact same, so feel free to contribute any help.
Thank you.
My solution is:
>> str='<HTML><b><FONT color="red" size="3">Hello</FONT></b></HTML>';
>> regexprep(str, '<.*?>','')
ans =
Hello
To match such a tag
<[^>]*>
See online here at Rubular
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With