The StringImporter is not importing cards that contain parenthesis in the name (for example cards with "(Rank 1)").
Steps to reproduce behavior
Open HDT.
Copy the following text:
Shadowstep x 2
Brain Freeze x 2
Guardian Augmerchant x 2
Pen Flinger x 2
Prize Plunderer x 2
Secret Passage x 2
Wand Thief x 2
Efficient Octo-bot x 2
Far Watch Post x 2
Swindle x 2
Wicked Stab (Rank 1) x 2
Field Contact x 2
Mankrik
Mor'shan Watch Post x 2
Kazakus, Golem Shaper
Jandice Barov
Kargal Battlescar
Select Import > Other > Clipboard > Save Only
Notice that the card "Wicked Stab (Rank 1)" is not imported.
Log/Screenshots
Warning|Database.GetCardFromName >> Could not get card from name: x
Fix
After checking the source code, I managed to fix this by just adding the parenthesis to the regex used in StringImported.cs:
private static readonly Regex CardLineRegexCountFirst = new Regex(@"(^(\s*)(?<count>\d)(\s*x)?\s+)(?<cardname>[\w\s'\.:!\-(),]+)");
private static readonly Regex CardLineRegexCountLast = new Regex(@"(?<cardname>[\w\s'\.:!\-(),]+?)(\s+(x\s*)?(?<count>\d))(\s*)$");
Bug report
Expected Behavior
All cards should be imported correctly.
Actual Behavior
The StringImporter is not importing cards that contain parenthesis in the name (for example cards with "(Rank 1)").
Steps to reproduce behavior
Log/Screenshots
Fix
After checking the source code, I managed to fix this by just adding the parenthesis to the regex used in StringImported.cs: