celestian
October 22nd, 2020, 15:19
I posted this in the Workshop but this should go here.
I noticed when parsing text from story entries that in FGC I would get a different result than if I ran it in FGU (same code).
The pattern match was this:
local sNoteText = DB.getValue(nodeStory,"text","");
local nStart, nEnd = string.find(sNoteText,'<linklist>[^<]+<link class="imagewindow" recordname="[^\"]+">[^<]+</link>[^<]+</linklist>',1);
(note the bold sections that will be missing in later examples)
Trying to match this:
<p>Links here:</p>
<linklist>
<link class="imagewindow" recordname="image.id-00003">wizard-token</link>
</linklist>
The pattern would match in FGC but not FGU.
Then I tried changing the FGU pattern matching to:
local nStart, nEnd = string.find(sNoteText,'<linklist><link class="imagewindow" recordname="[^\"]+">[^<]+</link></linklist>',1);
At which point it matched in FGU... which seems to indicate that the "newline"chars in FGU are somehow ignored/removed/something.
I noticed when parsing text from story entries that in FGC I would get a different result than if I ran it in FGU (same code).
The pattern match was this:
local sNoteText = DB.getValue(nodeStory,"text","");
local nStart, nEnd = string.find(sNoteText,'<linklist>[^<]+<link class="imagewindow" recordname="[^\"]+">[^<]+</link>[^<]+</linklist>',1);
(note the bold sections that will be missing in later examples)
Trying to match this:
<p>Links here:</p>
<linklist>
<link class="imagewindow" recordname="image.id-00003">wizard-token</link>
</linklist>
The pattern would match in FGC but not FGU.
Then I tried changing the FGU pattern matching to:
local nStart, nEnd = string.find(sNoteText,'<linklist><link class="imagewindow" recordname="[^\"]+">[^<]+</link></linklist>',1);
At which point it matched in FGU... which seems to indicate that the "newline"chars in FGU are somehow ignored/removed/something.