summaryrefslogtreecommitdiff
path: root/CSharp/Ivy
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp/Ivy')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index cfec5cb..8775944 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -14,6 +14,7 @@ namespace IvyBus
using System.Configuration;
using System.Windows.Forms;
using System.Globalization;
+ using System.Text.RegularExpressions;
/// <summary> The Main bus Class
/// </summary>
@@ -593,12 +594,18 @@ namespace IvyBus
internal bool CheckRegexp(String exp)
{
bool regexp_ok = true;
+ // TODO Bug
+ // ClockStop ClockStart & ^Clock(Start|Pause)
+ // should Stop to the first parent
if ((sent_messageClasses != null) && exp.StartsWith("^") )
{
regexp_ok = false;
- foreach (string exp_class in sent_messageClasses)
+ // extract first word from regexp...
+ string token = Regex.Replace(exp, @"^\^(?<token>[a-zA-Z_0-9-]+).*" , @"${token}");
+
+ foreach (string exp_class in sent_messageClasses)
{
- if ( exp.Substring(1).StartsWith(exp_class) )
+ if ( exp_class.StartsWith(token) )
return true;
}
}