Git Product home page Git Product logo

Comments (4)

sirfoga avatar sirfoga commented on August 27, 2024

date_format Matches dates like 19.08.15 and 19. 08. 2015: it's used to parse each date in a receipt
sum_format is analogous

from receipt-parser-legacy.

sagarhukkire avatar sagarhukkire commented on August 27, 2024

I meant to say how this line is working, if i want to add for 19-Aug-2015 or 08/19/2015, how i should change following line of code. Hope now its clear

date_format: '.*?(?P(\d{2,4}(.\s?|[^a-zA-Z\d])\d{2}(.\s?|[^a-zA-Z\d])(20)?1[3-6]))\s+'

from receipt-parser-legacy.

mre avatar mre commented on August 27, 2024

Working with regular expression is always a very... delicate endeavor.
Usually I use interactive tools like the awesome regex101 to come up with somewhat working expressions.
So here's a start, which matches your formats (including the existing ones):

(\d+)(.|-|\/)\s?([A-Za-z0-9]+)(.|-|\/)\s?(20)?(\d+)

Demo: https://regex101.com/r/HKXAbS/1

You might still need the .*? and the \s+ at the beginning and the end to make it work.

from receipt-parser-legacy.

sagarhukkire avatar sagarhukkire commented on August 27, 2024

you are winner man...thanks @mre

from receipt-parser-legacy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.