hy,
i am trying to get an AND regex to work for the last few hours and i give up and hope somebody here can help me...
first i file.read my voicecommands.xml
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="2.2.3.7" space="preserve" date="8/30/2017 12:00:00 AM">
<commandGroup open="True" name="Vox Commands" enabled="True" prefix="" priority="1" requiredProcess="" description="">
<command id="8" name="Don't Listen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Standby</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>ignore me,don't listen,stand by</phrase>
</command>
<command id="31" name="Listen" enabled="true" alwaysOn="True" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.On</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>computer, start listening, pay attention</phrase>
<event>Amulet.On</event>
</command>
<command id="32" name="Option" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Option</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Option,Select Option</phrase>
<payloadRange>1,10</payloadRange>
</command>
<command id="43" name="Vox Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Off</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>vox off, vox commando off,disable vox commando</phrase>
<event>Amulet.Off</event>
</command>
</commandGroup>
<commandGroup open="True" name="Show Help" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="266" name="Show help" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Help.ShowAll</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>These are all of the voice commands for this configuration.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Show help, What can I say</phrase>
</command>
<command id="264" name="Show active commands" enabled="False" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Help.ShowEnabled</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>These are voice commands in groups that are enabled.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Show</phrase>
<phrase optional="true">me, us</phrase>
<phrase optional="true">the</phrase>
<phrase>active, enabled</phrase>
<phrase optional="true">voice</phrase>
<phrase>commands</phrase>
</command>
<command id="305" name="Send help" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Read</cmdType>
<params>
<param>Resources\help.css</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.Write</cmdType>
<params>
<param>plugins\TCP\html\commandhelp2.html</param>
<param><html><head><meta charset="UTF-8"><title>aaaaa</title><style>{LastResult}asdfasdf</style></head></param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Help.ShowEnabled</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>Refreshing command list on your local web server.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.Read</cmdType>
<params>
<param>commandhelp2.html</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params>
<param></head>(.*?)$</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.Append</cmdType>
<params>
<param>plugins\TCP\html\commandhelp2.html</param>
<param>{Match.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Send help</phrase>
</command>
</commandGroup>
<commandGroup open="True" name="reuters" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="1173" name="Reuters news" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{Match.{i}.1} is the headline (where {i} is 1st, 2nd, 3rd ... headlines)
{Match.{i}.2} is the URL linking to each full story.

There will be more matches stored in the payload xml file than the 4 announced in the command.">
<action>
<cmdType>Scrape</cmdType>
<params>
<param>http://feeds.reuters.com/reuters/worldNews</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params>
<param><item>.*?<title>(.*?)<.*?description.*?<link>(.*?)<</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PayloadXML.Clear</cmdType>
<params>
<param>reuters.xml</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PayloadXML.AddPair</cmdType>
<params>
<param>reuters.xml</param>
<param>{Match.{i}.2}</param>
<param>{i}</param>
</params>
<cmdRepeat>{#M}</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Today's Reuter's headlines ({#M} total):</param>
<param>10000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<params>
<param>{i}. {Match.{i}.1}.</param>
</params>
<cmdRepeat>4</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<params>
<param>Here are the top 4 of {#M} Reuter's headlines</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>{i}. {Match.{i}.1}.</param>
</params>
<cmdRepeat>4</cmdRepeat>
</action>
<phrase>What's the news from Reuters</phrase>
</command>
<command id="1179" name="More from Reuters" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Shows the first line of the story. Reads out the whole story.

If you want it to only read the first few sentences, you can change {#M} to a specific number. So, if you use 2 instead of {#M} then it will read the first 3 lines, because the first sentence is read in the separate, TTS.Speak - {Match.1} action. (Or, you can create a separate "shut up" command with a TTS.Stop action to stop the TTS in mid-read. This would allow you to hear as much or as little as you wanted.)">
<action>
<cmdType>Launch.OpenURL</cmdType>
<params>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Scrape</cmdType>
<params>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params>
<param>="description"\scontent="(.*?)"</param>
<param><![CDATA[ ]]></param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>{Match.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{Match.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExSingle</cmdType>
<params>
<param><.*?midArticle_\d"></span><p>(.*?)<</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>{Match.{i}}</param>
</params>
<cmdRepeat>{#M}</cmdRepeat>
</action>
<phrase>Tell me more about headline number</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">reuters.xml</payloadFromXML>
</command>
</commandGroup>
</VoiceCommands>
and with my regex i want all commandnames where enabled="true"...
no matter what i tried i dont get it.
the first half of the regex works very well:
<command\s[^<>]*name="(.*?)"
gives me all the command names... but yeah... all of them. and i just want the enabled commands.
here would be a quick regex-onlinetool in case somebody wants to try...
http://regexr.com/