Page 1 of 1
How using Regular Expressions
Posted: 2015-01-21 07:06:25
by fulvio53s03
Dear Friends,
I need a way to change uppercase letters to lowcase letters when following HTML beginning tags
(i mean:
<Table to
<table or
</Div to
</div ecc.).
Do you think it could be possible?
Would you give me a statement example to insert in a script?
thanks in advance.

Posted: 2015-01-21 09:39:27
by antp
I doubt you can achieve that with regular expressions, but there is the LowerCase function that does that (it takes a string as input parameter and returns the lowercase function of it).
Posted: 2015-01-21 12:21:13
by fulvio53s03
antp wrote:I doubt you can achieve that with regular expressions, but there is the LowerCase function that does that (it takes a string as input parameter and returns the lowercase function of it).
Thanks.
I know function Lowercase, but I need to change only words between
< and
>
or
< and
>
.... see this:
Code: Select all
Procedure Normalizza_page(Pagina: string); // elimina i crlf, trasforma delimiters maiuscoli in minuscoli
begin
CharAbNormal := crlf;
CharNormal := ' ';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '<B';
CharNormal := '<b';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '</B';
CharNormal := '</b';
pagina := StringReplace(Value, CharAbNormal, CharNormal);
CharAbNormal := '<FONT';
CharNormal := '<font';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '</FONT';
CharNormal := '</font';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '<TR';
CharNormal := '<tr';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '</TR';
CharNormal := '</tr';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '<TD';
CharNormal := '<td';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '</TD';
CharNormal := '</td';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '<DIV';
CharNormal := '<div';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
CharAbNormal := '</DIV';
CharNormal := '</div';
pagina := StringReplace(pagina, CharAbNormal, CharNormal);
end;
Posted: 2015-01-21 15:24:31
by antp
But what's the point of that, actually?
Isn't the case of the tags always the same between different movies, for a given site?
Posted: 2015-01-21 16:42:45
by fulvio53s03
antp wrote:Isn't the case of the tags always the same between different movies, for a given site?
No, unfortunately sometime it happens, when changing pages lay-out of sites, that old pages have html tags with uppercase, new pages with lowercase (or vice-versa)....
It's not a great problem (if I see the changes or someone tells me about them), but, anyway, I was looking for a faster and more efficient way to solve problem, instead of running-after-it
uhm... maybe I could create a .pas file with my stringreplace statements.... what do you think?
bye