Open main menu

UESPWiki β

Morrowind Mod talk:XStringMatch

Unexpected behaviorEdit

I put all books from the game in one chest and ran this command

setx temp to xStringMatch bookName "trap"

. These are the matches I got:

The Firmament
The Doors of the Spirit
Chronicles of Nchuleft
Scroll of Elemental Burst:Frost
Scroll of Summon Golden Saint
Scroll of Drathis' Soulrot
Scroll of Tranasa's Spelltwist
Scroll of Insight
The Prayers of Baranat
Death Blow of Abernanit
The Firsthold Revolt
The Gold Ribbon of Merit
2920, Sun's Height
The Posting of the Hunt
Scroll of Icarian Flight
Scroll of Drathis' Winter Guest
Scroll of Savage Might
Scroll of The Oathfast
Scroll of Tousu's Abiding Beast
Scroll of Tranasa's Spelltrap

Can someone explain? qqqbbb (talk) 04:29, 7 July 2015‎ (UTC)

I've reproduced your results. And even the following script...
setx str to xStringBuild "The Firmament"
setx exp to xStringBuild "trap" ;exp is not included within str...
setx temp to xStringMatch str exp
if ( temp )
        MessageBox "WOE UPON YOU!"
endif
...produces the MessageBox! It's even the same if you use hardcoded string literals (instead of a var and xStringBuild). This looks like a serious bug! As you've suspected, this shouldn't happen. BTW, you can verify regexes via sites such as http://www.regexe.com/ (maybe it should be worked into the article). Like you, I've now encountered other matches with the "trap" regex that shouldn't happen, as well. This bug might only apply when you don't use any special characters in the regular expression (as the majority of the examples on-page have been verified in-game by me, while I was adding them).
We should probably tell Merzasphor about this, and link him to this page. And just to make certain, I've verified this bug occurs on both the normal MWSE branch (0.9.4a) DLL and his currently-latest (0.9.5-alpha.20150707). Golken (talk) 18:13, 9 July 2015 (UTC)
Return to "XStringMatch" page.