ID:2885676
 
Not a bug
BYOND Version:515.1612
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 115.0.0.0
Applies to:Dream Daemon
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:

Regex isn't filling in groups properly in some situations.

Code Snippet (if applicable) to Reproduce Problem:
mob/verb/TestParse()
var/regex/rgx_infocolumn = new/regex(@(''')(.*)\{\}(.*)''',"g") var/haystack = @(''')<span style="width:50%">{}</span>'''
var/result = rgx_infocolumn.Find(haystack,1)
if(!result)
src << "No match"
else
src << "Result = [result]"
for(var/g in rgx_infocolumn.group)
src << " [json_encode(g)]"


Expected Results:

Filled in groups

Actual Results:

Empty groups
Lummox JR resolved issue (Not a bug)
This was my own test case code, and I'm sad to say this bug report is my fault because I forgot the output was going to strip out HTML. I put html_encode() around the json_encode() calls and the groups no longer were empty. My bad.