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().