Hungry hungry regex matches :) (Typewriter.Play ArgumentOutOfRangeException)
Posted: Wed Nov 01, 2023 4:19 pm
Hey Tony -
Was debugging an issue with our game, and noticed we were getting an "ArgumentOutOfRangeException" - basically, we had a string that was coming in 30-40 chars less than it should, when it came time for the typewriter to play.
Basically, a string that started the method like this:
was finishing like this:
Basically, it was starting at the <sprite> tag and removing everything until the close of the <color> tag.
Traced it further, and found the Tools.StripTextMeshProTags was chopping off the extra text, and I traced it down to the sprite regex filter:
By changing this:
to the less hungry/more lazy:
it seemed to remove the error with no problems otherwise.
Don't know if that'll throw other problems later, but I figure you get enough messages with "I have a problem!" that the occasional "I have a solution!" is not out of line.
Thanks for all the work you do, you're awesome!
Edward
Was debugging an issue with our game, and noticed we were getting an "ArgumentOutOfRangeException" - basically, we had a string that was coming in 30-40 chars less than it should, when it came time for the typewriter to play.
Basically, a string that started the method like this:
Code: Select all
If you don\'t have enough <sprite=\"StatIcons\" name=enervation> energy (<color=#EE8695>displayed in the bottom left of the screen</color>), then you won\'t be able to play the card.
Code: Select all
If you don\'t have enough ), then you won\'t be able to play the card.
Traced it further, and found the Tools.StripTextMeshProTags was chopping off the extra text, and I traced it down to the sprite regex filter:
By changing this:
Code: Select all
<sprite=.+>
Code: Select all
<sprite=.+?>
Don't know if that'll throw other problems later, but I figure you get enough messages with "I have a problem!" that the occasional "I have a solution!" is not out of line.
Thanks for all the work you do, you're awesome!
Edward