A few things that may help:
1. In this case, I'd recommend using the action Results.RegExSingle rather than Result.RegEx (
http://voxcommando.com/mediawiki/index.php?title=Actions#RegExSingle).
That way, you don't need to try to remove line feed characters etc. to try to match multi-line strings.
2. Watch out for regex "greediness". (see lower down on this page:
http://www.regular-expressions.info/repeat.html).
It seems that you're often trying to use
.* rather than
.*?The question mark is needed, otherwise it will continue to hunt for the last instance of the character that comes after .* in the entire string being scraped, rather than stopping at the nearest neighbouring instance of that character.
The following version of your command reads the first 4 CBC headlines:
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.4-->
<command id="1240" name="CBC news (headlines only)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Scrape</cmdType>
<params>
<param>{2}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params>
<param>item.*?<title><.*?DATA.(.*?)\]</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Today's CBC {1} headlines:</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<params>
<param>{i}. {Match.{i}}</param>
</params>
<cmdRepeat>4</cmdRepeat>
</action>
<event>News.CBC</event>
</command>
In your command, if the original regular expression you used had worked, the OSD message would have been:
1. first headline
2. 2nd headline
3. 3rd headline
4. 4th headline
1. first article link
2. 2nd article link
3. 3rd article link
4. 4th article link
1. first story nugget
2. 2nd story nugget
3. 3rd story nugget
4. 4th story nugget
Is that what you were aiming for? If you can clarify, I can then help with achieving the final goal.
3. ... One other thought, which may not be appropriate for how you're using VC which seems to rely a lot on event-triggered commands, but:
You are passing 2 payloads to this command -- the link you want to scrape, and the topic. If you were to issue a voice command to call this command directly ("What are today's {top stories}"), you could use a payload xml file of the form:
value = link ; phrase = feed name
In that case, your command would use {1} (link to scrape) and {PF.1} (name of feed) instead of {2} and {1}. [http://voxcommando.com/mediawiki/index.php?title=Variables#Payloads]
I realize you may already be familiar with the friendly payload variable, but just in case you're not I figured I should mention it.