Reputation: 5789
I would like to extract some text contained in HTML tags. For example:
<html><body>this is a warning message. wrongs values</body></html>
the result should get the message by ignoring all HTML tags.
Does anyone have any suggestion?
Upvotes: 0
Views: 447
Reputation: 124563
You can strip HTML tags using regular expressions:
str = '<html><body>this is a warning message. wrongs values</body></html>';
str2 = regexprep(str, '<[^>]*>', '')
Upvotes: 1
Reputation: 12142
You want something like this:
a = sscanf('<html><body>this is a warning message. wrongs values</body></html>','<html><body>%[a-zA-Z., ]</body></html>')
Upvotes: 1