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

Mapping Regex is not matching #85

Open
briviere opened this issue Sep 20, 2015 · 1 comment
Open

Mapping Regex is not matching #85

briviere opened this issue Sep 20, 2015 · 1 comment

Comments

@briviere
Copy link

If the pattern you are try to match is at the start of the string then it will match otherwise it will not find an match

Patten: /TFR-TO 1234456/

Desciption to check for match: "WU-005 TFR-TO 123456"

will not work unless I change the match code to search as follows:

            if m[0].search(entry.desc, 0):
                payee, account, tags = m[1], m[2], m[3]
                found = True

thanks

Brian

@kalafut
Copy link
Contributor

kalafut commented Oct 16, 2016

Brian,

Just change your pattern to /.*TFR-TO 123456/ and it will work. You have to match from the beginning of the string onward, so the modified regex just consumes any number of leading characters and will perform the same as search().

Jim

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