Topic: TRegExp and StrReplace
Hello Dmitry,
TRegExp was a real breakthrough for me because it helped me scraping web pages more easily.
But sometimes, instead of matching strings between matched searches, we want to replace a pattern with something else into a large string.
As an example, stripping HTML tags from a large text.
One RegEx pattern for matching any html tag without having to worry for what's inside the < > is :
<[^<>]+>
With this pattern, I'd like to simply delete the HTML tags but
ReplaceStr(detail_string,reg3.match,'');
does not work because reg3.match is a TStringList and detail_string is a string.
Could we have something like ?
for i := 0 to reg3.match.Count -1 do
Reg3.Replace(detail_string, '<[^<>]+>', '');
(or whatever the loop you use)
Thanks for reading and have a good day
Cheers
Mathias
Each time I get a divorce, I keep the house
Zaza Gabor