ID:2027070
 
Resolved
regex.Replace() returned a number instead of a string.
BYOND Version:510
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 47.0.2526.111
Applies to:Dream Daemon
Status: Resolved (510.1322)

This issue has been resolved.
Descriptive Problem Summary:
regex.Replace() returns a number unexpectedly when a string is expected.

Numbered Steps to Reproduce Problem:
Run the attached verb.

Code Snippet (if applicable) to Reproduce Problem:
/client/verb/test_regex()
var/regex/test = regex("s{1,2}(?!s)", "g")
world << test.Replace("the Ses in this string should look all hissey", "sss")


Expected Results:
"the Sesss in thisss ssstring ssshould look all hisssey"

Actual Results:
342

Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?
Never

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
N/A

Workarounds:
Don't use replacetext(string, regex) or regex.Replace().
The below prints the expected "adc"; it seems the default return value from Replace()/replacetext() is not the replaced string.

/world/New()
var/regex/R = regex("b+")
world.log << R.Replace("abbbc", "d")

del(src)

/regex/Replace()
..()
return text
Lummox JR resolved issue with message:
regex.Replace() returned a number instead of a string.
Found the issue. Apparently something got broken in a minor reorg and although I thought it had gotten properly retested, apparently not so much.