But when I use it in KM, the KM engine crashes. I guess there is some kind of infinite loop or something I am causing that isn't triggering an error on this Regexr tool?
Thanks in advance for any tips to get this working, I can provide more info, I did best to keep this post brief!
Thanks for your help, Tom. Strange, for me it is crash city. KM Engine icon in the menu bar freezes immediately and can see KM going nuts the Activity Monitor. Tried rebooting, no difference. Any idea if there is some kind of cache I can reset or something to try to eliminate crashing?
I had tried that and still had the same problem. But right now I tried copying the exact same text I had pasted in that Regexr tool back into KM and no crashing!
So I think I have narrowed it down to a problem with the text that Excel is capturing to that variable. If I copy and paste it from Excel to another app first (including textedit), all is good. But if I use a macro to copy the text directly from Excel to KM, it's a first-class trip to crash city.
Very strange since this is plain text. Maybe something to do with text encoding? I will experiment with a way to try to re-reecode that text coming out of excel before putting it into KM to see if that helps. Any suggests for how to do this are very welcome.
If you're interested in checking out the crash, here is the text macro attached.
Thanks again for your help Tom, at least I know it wasn't a regex+KM problem.
But right now I tried copying the exact same text I had pasted in that Regexr tool back into KM and no crashing!
Thatâs what I did, too, and because of that I asked you to test it.
But if I use a macro to copy the text directly from Excel to KM, it's a first-class trip to crash city.
Very strange since this is plain text. Maybe something to do with text encoding?
Iâm sure that Excel is doing very strange things (like all MS applications). A probably more consistent way could be to work with text files (csv), exported from Excel.
And to further simplify the regex (no capturing needed here): (?sm)^\t\t.*?(?=\n\t\t)
And if you donât need/want the tabs at the beginning of the substring, this is cleaner: (?sm)(?<=^\t\t).*?(?=\n\t\t)
(You didnât see the 2 tabs in the Alert box because apparently the Alert Box action automatically stripped them away. In a âDisplay text in a windowâ action you would see them.)
I would have never figured that out in a million yearsâŚ
You have no idea how relieved I am⌠I spent the last couple hours exporting the content directly from Google drive as CSV, using regex to convert to tab delimited (to make it work with my huge daisy-chained macro).
After all that work it was STILL crashing.
But adding that Unix line ending filter completely fixed it.
What is the best way to thank you for your generous time?