Contains Match for Custom Table numeric value not matching

Hello,
What I'm trying to achieve
I want to file all my scanned receipts by the credit/debit account billed according to the payment device that was used, e.g. AMEX xxx1234, Mastercard xxx5678.
We have a number of combinations to match (All Accounts x His/Hers x Card/iPhone/iPad/Watch) and this list gets updated with every iOS/iPadOS/watchOS update or new card, etc. The CSV file is exported from Numbers using UTF-8 encoding (the default).
The Problem I'm Seeing
When using a Contains Match rule with a Custom Table that matches on 'Card Type' and 'Last Digits', it does not match the last digits in all cases. Rule Preview shows a Green Tick for Card Type and a Red Cross for Last Digits.
Observations
1. For the failing cases, if I open the OCR'd PDF receipt in Preview, I can search for the Last Digits and it finds them.
2. Neither of these command-lines find the matching terms:
3. Spotlight works fine - both of these find the file:
4. GhostScript can find the text:
What else can I do to troubleshoot/diagnose the issue?
What I'm trying to achieve
I want to file all my scanned receipts by the credit/debit account billed according to the payment device that was used, e.g. AMEX xxx1234, Mastercard xxx5678.
We have a number of combinations to match (All Accounts x His/Hers x Card/iPhone/iPad/Watch) and this list gets updated with every iOS/iPadOS/watchOS update or new card, etc. The CSV file is exported from Numbers using UTF-8 encoding (the default).
The Problem I'm Seeing
When using a Contains Match rule with a Custom Table that matches on 'Card Type' and 'Last Digits', it does not match the last digits in all cases. Rule Preview shows a Green Tick for Card Type and a Red Cross for Last Digits.
Observations
1. For the failing cases, if I open the OCR'd PDF receipt in Preview, I can search for the Last Digits and it finds them.
2. Neither of these command-lines find the matching terms:
- Code: Select all
strings /path/to/receipt.pdf | grep -i Mastercard
strings /path/to/receipt.pdf | grep 5678
3. Spotlight works fine - both of these find the file:
- Code: Select all
mdfind Mastercard | grep /path/to/receipt.pdf
mdfind 5678 | grep /path/to/receipt.pdf
4. GhostScript can find the text:
- Code: Select all
gs -sDEVICE=txtwrite -o contents.txt /path/to/receipt.pdf
grep -i mastercard contents.txt # works
grep -i 5678 contents.txt # works
What else can I do to troubleshoot/diagnose the issue?