Regular expressions in GnuCash

David T. sunfish62 at yahoo.com
Sat Sep 24 04:09:46 EDT 2016


Peter,

Thank you for your perspective on this; I agree on the “clunky” designation, but would take this a little further. While I appreciate everyone’s input on the possibilities of Regex syntax, I am dismayed at the prospects for the original poster, as well as the broader user base. 

Let me ask you all this: if I asked you to get in your car and drive to the store to pick up some milk and eggs, would you think it reasonable to have to read six online manuals, and then construct and test several different types of key in order to start your car? Or do you expect to get in your car, start it up and drive it off without much consideration at all? I believe that most drivers expect their cars to “just work” when they get in to go to the store.

Well, I would hope for the same kind of “It Just Works” functionality from my accounting program with regards to extracting basic information (such as information on a range of checks) from my accounting data.

My point is this: Yes, there are ways to use the tools provided to achieve the desired end—but are they easy to use and intuitive to a wide audience? 

Moreover, is it appropriate to expect every user to become familiar with an arcane (and yes, Regex IS arcane) mathematical code in order to find this kind of information? 

Finally, adopting the implied mindset that “These tools work, and users should adapt to them" runs counter to the very idea of improvement and innovation. I sincerely hope that we all can continue to seek better and easier ways of meeting user needs.

Best,
David T.

> On Sep 23, 2016, at 11:54 AM, prl <prl at ozemail.com.au> wrote:
> 
> Without some further tweaking, it will also match (parts of) 91234, 991234, etc... The RE needs some sort of start/end marking; in this case, "^..re below...$" would do the job.
> 
> And I stand by my "clunky" description, even though there probably aren't cleaner REs that will work for that match example. Regular expressions are just a bit clumsy to use to do this sort of thing, even if they can be made to work.
> 
> Peter
> 
> On 23/09/2016 15:12, Dean Gibson wrote:
>> To select everything from "1234" to "5678" (extended regular expressions):
>> 
>> 1(2(3[4-9]|[4-9][0-9])|[3-9][0-9][0-9])|([2-4][0-9][0-9][0-9])|5([0-5][0-9][0-9])|6([0-6][0-9]|7[0-8]) 
>> 
>> or:
>> 
>> 123[4-9]|12[4-9][0-9]|1[3-9][0-9][0-9]|[2-4][0-9][0-9][0-9]|5[0-5][0-9][0-9]|56[0-6][0-9]|567[0-8] 
>> 
>> Both are equivalent, but the second is probably easier to understand, but both provide a good learning example.
>> 
>> Plus, after learning this, accounting will seem much easier ...
>> 
>> On 2016-09-22 21:43, prl wrote:
>>> On 23/09/2016 09:41, DaveC49 wrote:
>>>> Regex is a pattern matching search rather than a numerical search and is probably overkill for just finding a range of numbers however imported cheque numbers, invoice numbers etc may not also be strictly numeric or in a form for which a numerical search can be effective e.g. leading zeroes and alphabettic or symbolic content.
>>> 
>>> Writing a regex to match a precise range of numbers (even if just integers)  would be clunky. It's probably not a good introductory exercise in regular expressions.
>>> 
>>> Peter
>> 
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.




More information about the gnucash-user mailing list