Open ldeluigi opened 3 years ago
Card name and set code are fine (xmage must use scryfall sets and codes): https://scryfall.com/card/prna/246p/breeding-pool
There are must be bug in mtga parser.
I removed my hypothesis. I don't understand the cause
Bug somewhere in the search pattern:
@ldeluigi All your cases contain non-numerical characters ;)
Bug somewhere in the search pattern:
I have written an MTGA parser for one of my projects, so here are some findings that you can benefit from:
Two things need to change:
()?
. (Including the space before the collector number)First claim: TappedOut MTGA exports may not contain the collector number. A deck for reference: https://tappedout.net/mtg-decks/yarok-throw-your-lands-in-the-air/ The MTGA export of that deck contains lines like this (shortened the list)
1 Root Maze (10E)
1 Sakura-Tribe Scout (SOK)
1 Shrieking Drake (VIS)
1 Tainted Pact (ODY)
Second claim:
*96
tvdl54sb
64★
For reference, this is my RE that parses the MTGA format and works for the given cases:
(?P<copies>\d+) (?P<name>.+) \((?P<set_code>\w+)\)( (?P<collector_number>.+))?
It uses the Python RE syntax with named groups to extract the information from the lines. It may not be useful for you directly, but could serve as a reference point
Unable to retrieve information for "?P
Edit: I tested it, and it seems to work. So this is invalid.
Another point: Does \p{Alnum}+
match any of -_
or accented characters?
I used google a bit, but didn’t find a definite answer, but it points towards "no".
In other words, does the parser work with this deck list?
1 Abzan Kin-Guard (FRF) 120
1 _____ (UNH) 23
1 Séance (MM3) 22
1 Déjà Vu (POR) 53
This list contains a hyphen, underscores and accented characters.
I suggest to use \S+
instead of \p{Alnum}+
, which should match those.
As you can see:
I exported the list from moxfield (MTGA format).