Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups matching not working as expected #14

Open
vittot opened this issue Apr 27, 2022 · 1 comment
Open

Groups matching not working as expected #14

vittot opened this issue Apr 27, 2022 · 1 comment

Comments

@vittot
Copy link

vittot commented Apr 27, 2022

If I have the following regex group:

Full_Date:
    Basic Full_Date:
        Expression: ([0-3]?[0-9]) \. ([0-1]?[0-9]) \. (20[0-9][0-9])
        Matches: 01.01.2021
        Non-Matches: 01--01-2021 | 01.01.1990
        Groups:
            - Day
            - Month
            - Year

and the following function, associated to Basic Full_Date:

def full_date(Day, Month, Year):
    print('full_date', Day, Month, Year)
    if Day is None or Month is None or Year is None or Day=='' or Month=='' or Year=='' or len(Day) > 2 or len(Month) > 2:
         return None
    if len(Day) == 1:
        Day = '0' + Day
    if len(Month) == 1:
        Month = '0' + Month
    return {'day':Day, 'month':Month, 'year':Year}

how is it possible that when parsing the string 21.2.2021 the function is called with Day= 21.2.2021, MOnth=21 and year=2 ? It does not make any sense to me

@andychase
Copy link
Owner

andychase commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants