<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Samy</title>
    <description>The latest articles on DEV Community by Samy (@descriptorapi).</description>
    <link>https://dev.to/descriptorapi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4265300%2F9ef7cf14-1383-4cfb-af72-a15725717baf.png</url>
      <title>DEV Community: Samy</title>
      <link>https://dev.to/descriptorapi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/descriptorapi"/>
    <language>en</language>
    <item>
      <title>Parsing Arabic and Latin card statement lines in the same feed</title>
      <dc:creator>Samy</dc:creator>
      <pubDate>Wed, 25 Nov 2026 18:00:37 +0000</pubDate>
      <link>https://dev.to/descriptorapi/parsing-arabic-and-latin-card-statement-lines-in-the-same-feed-f29</link>
      <guid>https://dev.to/descriptorapi/parsing-arabic-and-latin-card-statement-lines-in-the-same-feed-f29</guid>
      <description>&lt;p&gt;If your users bank in the Gulf or North Africa, one statement feed will mix Arabic and Latin script. A line can look like this (illustrative):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;POS 8812 GEIDEA*مطعم النخيل CAIRO EG&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That is a terminal number, a regional processor (Geidea), a merchant name in Arabic, and a city and country code in Latin letters. A parser built for &lt;code&gt;STARBUCKS #1234 NEW YORK NY&lt;/code&gt; has no idea what to do with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four things that break naive parsers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mixed script and direction.&lt;/strong&gt; Arabic text is stored in logical order but displayed right to left. If you split on spaces and reverse or truncate, you can cut a name in the middle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regional processors.&lt;/strong&gt; Names like Geidea sit in front of the merchant the way SQ * does for Square. Strip them before you match, but keep them: they tell you the country.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local rails.&lt;/strong&gt; mada, SADAD, sarie, STC Pay, urpay, Fawry and InstaPay lines are often transfers or bill payments, not shop purchases. Check what kind of line it is before you chart spend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One shop, many spellings.&lt;/strong&gt; The same cafe can show up in Arabic, in a transliteration, and in an abbreviation, depending on the terminal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pay-later instalments from Tabby and Tamara add one more case: the line names the instalment provider, not the shop.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical approach
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Normalise first. Unicode-normalise, strip tatweel and diacritics, and fold common letter variants before you compare strings.&lt;/li&gt;
&lt;li&gt;Separate the channel, processor and terminal from the merchant text, then match the merchant text on its own.&lt;/li&gt;
&lt;li&gt;Keep a &lt;code&gt;kind&lt;/code&gt; field (purchase, transfer, bill, refund, fee) and a confidence score. Do not force a merchant when you cannot tell.&lt;/li&gt;
&lt;li&gt;Show uncertain results as "suggested" in your UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;I built DescriptorAPI to do this over one HTTP call. There is a free plan and a browser playground:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Playground: &lt;a href="https://descriptorapi.com/playground" rel="noopener noreferrer"&gt;https://descriptorapi.com/playground&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Guide to the region: &lt;a href="https://descriptorapi.com/learn/transaction-enrichment-mena" rel="noopener noreferrer"&gt;https://descriptorapi.com/learn/transaction-enrichment-mena&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Saudi lines: &lt;a href="https://descriptorapi.com/learn/reading-saudi-card-statements" rel="noopener noreferrer"&gt;https://descriptorapi.com/learn/reading-saudi-card-statements&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have lines it gets wrong, send them to me and I will fix them.&lt;/p&gt;

&lt;p&gt;Drafted with AI help, edited and checked by me.&lt;/p&gt;

</description>
      <category>api</category>
      <category>fintech</category>
      <category>python</category>
      <category>arabic</category>
    </item>
    <item>
      <title>Reading UAE card statements in code: turning "POS 4521 CAREEM*RIDE DXB AE" into a merchant</title>
      <dc:creator>Samy</dc:creator>
      <pubDate>Wed, 25 Nov 2026 17:44:51 +0000</pubDate>
      <link>https://dev.to/descriptorapi/reading-uae-card-statements-in-code-turning-pos-4521-careemride-dxb-ae-into-a-merchant-3473</link>
      <guid>https://dev.to/descriptorapi/reading-uae-card-statements-in-code-turning-pos-4521-careemride-dxb-ae-into-a-merchant-3473</guid>
      <description>&lt;p&gt;If you build anything that shows a user their card transactions, you meet the descriptor problem fast. The bank does not write "Careem". It writes &lt;code&gt;POS 4521 CAREEM*RIDE DXB AE&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is in the line
&lt;/h2&gt;

&lt;p&gt;A statement line is a fixed-width field written by the merchant's acquirer, not by your bank. A typical Emirates line carries a channel (POS), a terminal number, a payment processor or aggregator prefix, a truncated merchant name, a city code (DXB) and a country code (AE). Mall names, utilities and toll lines follow their own abbreviations. I wrote a longer guide here: &lt;a href="https://descriptorapi.com/learn/reading-uae-card-statements" rel="noopener noreferrer"&gt;https://descriptorapi.com/learn/reading-uae-card-statements&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why regex stops working
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Aggregator prefixes (SQ *, PAYPAL *, AMZN Mktp) hide the real merchant.&lt;/li&gt;
&lt;li&gt;Not every line is a purchase: transfers, refunds, fees and declines look similar.&lt;/li&gt;
&lt;li&gt;In the Gulf and North Africa you also see Arabic script, mada, SADAD, Fawry, InstaPay, and pay-later instalments from Tabby and Tamara.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One call
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.descriptorapi.com/v1/enrich \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $DESCRIPTORAPI_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"descriptor": "POS 4521 CAREEM*RIDE DXB AE", "country": "AE"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response has &lt;code&gt;merchant&lt;/code&gt; (name, category, website, logo), &lt;code&gt;location&lt;/code&gt;, &lt;code&gt;processor&lt;/code&gt;, &lt;code&gt;kind&lt;/code&gt; and a &lt;code&gt;confidence&lt;/code&gt; from 0 to 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling the awkward cases
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;merchant: null&lt;/code&gt; means we could not tell. These calls are free. Show the raw line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;source: "ai"&lt;/code&gt; with &lt;code&gt;verified: false&lt;/code&gt; means the merchant was read from the text itself. Show these differently, for example with a "suggested" label, until verified.&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;kind&lt;/code&gt; before charting spend. A salary or a refund is not a merchant.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Playground (decode a line in the browser): &lt;a href="https://descriptorapi.com/playground" rel="noopener noreferrer"&gt;https://descriptorapi.com/playground&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://descriptorapi.com/docs" rel="noopener noreferrer"&gt;https://descriptorapi.com/docs&lt;/a&gt;&lt;br&gt;
There is a free plan, so you can test with your own statements.&lt;/p&gt;

&lt;p&gt;I built DescriptorAPI. Tell me which statement lines it gets wrong and I will fix them.&lt;/p&gt;

&lt;p&gt;Drafted with AI help, edited and checked by me.&lt;/p&gt;

</description>
      <category>api</category>
      <category>fintech</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
