On Rubular, the following regular expression evaluates 7 match groups - as expected
/^<(\w+)\s*(\w+=".*")*\s*(??:\/\s*>)|(?:>(.*)<\s*\/\s*\1\s*>))$/mHowever, the following line only returns the last match in a note box.
/^<(\w+)\s*(\w+=".*")*\s*(??:\/\s*>)|(?:>(.*)<\s*\/\s*\1\s*>))$/m.match(note) { |m| name = m[1] attributes = @options[:parse_attr].call(m[2]) innerText = @options[:parse_text].call(m[3]) msgbox_p("#{name} found with attributes: #{attributes.join(',')}. innerText=#{innerText}")}The note contains the following text:
This be text
<tag/>
<tag2></tag2>
<tag3 value="text" />
<tag4>innerText</tag4>
<tag5 value="text" value2="text">
inertia
</tag5>
<alert>Message from a1</alert>
<actor_tag>inner text</actor_tag>
<tag/>
<tag2></tag2>
<tag3 value="text" />
<tag4>innerText</tag4>
<tag5 value="text" value2="text">
inertia
</tag5>
<alert>Message from a1</alert>
<actor_tag>inner text</actor_tag>
Any ideas why the engine appears to parse differently from the note section? Is there some oddness with line-breaks that I'm neglecting?