Registered Member
|
Dear KMyMoney enthusiasts,
How do I build a regular expression to extract the payee/receiver information from the subject/details of a transaction (Option in Account Settings - Tab Online Settings)? Could somebody be so kind and give me an example? Thanks in advance, Thomas |
KDE Developer
|
Hi,
First you need to take a look at the data from which you want to extract your quotes. It can be from any website. In the on-line quote configuration page from the settings enter the URL for this website. You can use %1 which will be replaced with the security name. After that you need two regular expression for the price and for the date. For example (\d+.\d+) matches something like 5.89, 90.89. You can read more about regular expressions at http://doc.trolltech.com/4.6/qregexp.ht ... characters or even try your own regular expressions with the qt example application http://doc.trolltech.com/4.6/tools-regexp.html
cristian.onet, proud to be a member of KDE forums since 2008-Oct.
|
KDE Developer
|
So I'll give it a try. One of my banks stores the name of the payee/receiver as the first 27 characters of the memo field. Sometimes, they don't do that and use even the first 27 characters for the memo (usually these are messages from the bank itself). So here's what I have setup to cope with this:
The trick is to enclose the part you are interested in into parenthesis. http://doc.trolltech.com/4.6/qregexp.ht ... uring-text has more on that. So the above translates to:
A dot in regexp's means 'any character'. An asterisk means 'zero or more occurrences'. Also, I fill the exceptions list with the corresponding messages from the bank. They also can be regexp's. In case you still have problems (this is after all not the easiest concept to understand - I am just doing it for so long now ), give us an example of what you get from the bank and we try to figure out the regexps for you. If you have a working setting, please drop a note here by naming the bank, so others benefit as well.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
Dear Christian, Dear ipwizard,
thanks for your replies! ipwizard's solution works fine for me:
I am trying to download the credit card information at PSD Bank. It seems the bank sends 108 chars, where 27 chars always represent one line and the first line is the payee. Thanks for your support, Thomas PS: In the meantime I have found some very good resources about regular expressions ... German Tutorial: http://www.danielfett.de/internet-und-opensource,artikel,regulaere-ausdruecke Online testing: http://rubular.com/ |
KDE Developer
|
PSD and Sparda Bank use the same URL, so the regex's should be identical
Thanks for the links to the regex stuff. That should be helpful for others.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
I have to correct myself after playing around a little bit. For Credit Card information at PSD Bank, the following regular expressions work best:
|
KDE Developer
|
If I spot that right, the opening parenthesis is missing in your payee entry
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]