Regular expression ile tcmb kurlarını almak istiyorum ama doğru şekilde parçalayamıyorum.
Kod: Tümünü seç
var
cMatch:Tmatch;
cRegEx:TRegEx;
begin
cRegEx:=tRegEx.Create('<Currency.*>(.*)</Currency>',[roIgnoreCase,roMultiline]);
cMatch:=cRegEx.Match(Veri);
memo1.text:=cmatch.Groups[0].Value; //BURADA BÜTÜN XML KODU GELİYOR ama ilk Currency tagın gelmesi gerekiyordu
memo1.text:=cmatch.Groups[0].Value; //BURADA Hiç birşey gelmiyor ama ilk Currency tagın içeriğinin gelmesi gerekiyordu
end;
Kod: Tümünü seç
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="isokur.xsl"?>
<Tarih_Date Tarih="27.10.2015" Date="10/27/2015" Bulten_No="2015/205">
<Currency CrossOrder="0" Kod="USD" CurrencyCode="USD">
<Unit>1</Unit>
<Isim>ABD DOLARI</Isim>
<CurrencyName>US DOLLAR</CurrencyName>
<ForexBuying>2.8943</ForexBuying>
<ForexSelling>2.8995</ForexSelling>
<BanknoteBuying>2.8923</BanknoteBuying>
<BanknoteSelling>2.9038</BanknoteSelling>
<CrossRateUSD>1</CrossRateUSD>
<CrossRateOther />
</Currency>
<Currency CrossOrder="1" Kod="AUD" CurrencyCode="AUD">
<Unit>1</Unit>
<Isim>AVUSTRALYA DOLARI</Isim>
<CurrencyName>AUSTRALIAN DOLLAR</CurrencyName>
<ForexBuying>2.0924</ForexBuying>
<ForexSelling>2.106</ForexSelling>
<BanknoteBuying>2.0828</BanknoteBuying>
<BanknoteSelling>2.1186</BanknoteSelling>
<CrossRateUSD>1.38</CrossRateUSD>
<CrossRateOther />
</Currency>
<Currency CrossOrder="0" Kod="XDR" CurrencyCode="XDR">
<Unit>1</Unit>
<Isim />
<CurrencyName />
<ForexBuying>4.0506</ForexBuying>
<ForexSelling />
<BanknoteBuying />
<BanknoteSelling />
<CrossRateUSD />
<CrossRateOther>1.39827</CrossRateOther>
</Currency>
</Tarih_Date>
Kod: Tümünü seç
<Unit>1</Unit>
<Isim>ABD DOLARI</Isim>
<CurrencyName>US DOLLAR</CurrencyName>
<ForexBuying>2.8943</ForexBuying>
<ForexSelling>2.8995</ForexSelling>
<BanknoteBuying>2.8923</BanknoteBuying>
<BanknoteSelling>2.9038</BanknoteSelling>
<CrossRateUSD>1</CrossRateUSD>
<CrossRateOther />