Regex Help

Can you try to see whether escaping: works (I.e., using \: )

Kind regards,

Martijn Brinkers

···

---
Sent with DJIGZO for Android. Please excuse my brevity.

----- Original message -----
Am attempting to use the following signing regex trigger:

(?i)(^subject :\s\[sign\]|^x-secure-sign :\strue$)

but when I review the log file I am seeing:

02 Aug 2012 09:25:03 | WARN Invalid pattern. Trigger: (?i)(^subject :\s\[sign\]|^x-secure-sign :\strue$) (mitm.application.djigzo.james.matchers.SenderHeaderTrigger) [Spool Thread #0]
java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 33
\s\[sign\]|^x-secure-sign :\strue$)
^
The braces match so am missing why the parser believes they are unmatched ?

--
Thanks, Phil

_______________________________________________
Users mailing list
Users(a)lists.djigzo.com
http://lists.djigzo.com/lists/listinfo/users

Still the same:

02 Aug 2012 09:56:02 | WARN Invalid pattern. Trigger: (?i)(^subject \:\s\[sign\]|^x-secure-sign \:\strue$) (mitm.application.djigzo.james.matchers.SenderHeaderTrigger) [Spool Thread #3]
java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 34
\s\[sign\]|^x-secure-sign \:\strue$)

I also tried double bracing the regex from examples I have see on-line for groupings:

(?i)(^subject \:\s\[sign\])|(^x-secure-sign \:\strue$)

···

--
Thanks, Phil

----- Original Message -----

Can you try to see whether escaping: works (I.e., using \: )

Kind regards,

Martijn Brinkers

---
Sent with DJIGZO for Android. Please excuse my brevity.

----- Original message -----
Am attempting to use the following signing regex trigger:

(?i)(^subject :\s\[sign\]|^x-secure-sign :\strue$)

but when I review the log file I am seeing:

02 Aug 2012 09:25:03 | WARN Invalid pattern. Trigger: (?i)(^subject
:\s\[sign\]|^x-secure-sign :\strue$)
(mitm.application.djigzo.james.matchers.SenderHeaderTrigger) [Spool
Thread #0]
java.util.regex.PatternSyntaxException: Unmatched closing ')' near
index 33
\s\[sign\]|^x-secure-sign :\strue$)
^
The braces match so am missing why the parser believes they are
unmatched ?

--
Thanks, Phil

_______________________________________________
Users mailing list
Users(a)lists.djigzo.com
http://lists.djigzo.com/lists/listinfo/users

Still unable to get this to work :frowning: What JAVA package does Djigzo use for its regex ? Wondering if there is a way of testing outside of Djigzo.

···

--
Thanks, Phil

----- Original Message -----

Still the same:

02 Aug 2012 09:56:02 | WARN Invalid pattern. Trigger: (?i)(^subject
\:\s\[sign\]|^x-secure-sign \:\strue$)
   (mitm.application.djigzo.james.matchers.SenderHeaderTrigger)
[Spool Thread #3]
java.util.regex.PatternSyntaxException: Unmatched closing ')' near
index 34
\s\[sign\]|^x-secure-sign \:\strue$)

I also tried double bracing the regex from examples I have see
on-line for groupings:

(?i)(^subject \:\s\[sign\])|(^x-secure-sign \:\strue$)
--
Thanks, Phil

----- Original Message -----
> Can you try to see whether escaping: works (I.e., using \: )
>
> Kind regards,
>
> Martijn Brinkers
>
> ---
> Sent with DJIGZO for Android. Please excuse my brevity.
>
> ----- Original message -----
> Am attempting to use the following signing regex trigger:
>
> (?i)(^subject :\s\[sign\]|^x-secure-sign :\strue$)
>
> but when I review the log file I am seeing:
>
> 02 Aug 2012 09:25:03 | WARN Invalid pattern. Trigger: (?i)(^subject
> :\s\[sign\]|^x-secure-sign :\strue$)
> (mitm.application.djigzo.james.matchers.SenderHeaderTrigger) [Spool
> Thread #0]
> java.util.regex.PatternSyntaxException: Unmatched closing ')' near
> index 33
> \s\[sign\]|^x-secure-sign :\strue$)
> ^
> The braces match so am missing why the parser believes they are
> unmatched ?
>
> --
> Thanks, Phil
>
> _______________________________________________
> Users mailing list
> Users(a)lists.djigzo.com
> http://lists.djigzo.com/lists/listinfo/users
>
>
_______________________________________________
Users mailing list
Users(a)lists.djigzo.com
http://lists.djigzo.com/lists/listinfo/users

Hmmm. I found this site which is a simple Java regex tester:

http://www.cis.upenn.edu/~matuszek/General/RegexTester/regex-tester.html

I deconstructed my regex and then rebuilt it step by step until I had no further Syntax Exceptions and ended up with :

(?i)(subject\s:\s\[sign\].*)|(x-secure-sign\s:\strue)

running this through the tester using a sample of:

resulted in the following:

start() = 0, end() = 21
group(0) = "Subject : [sign] test"
group(1) = "Subject : [sign] test"
group(2) = "null"

so that pattern worked perfectly. I then took that same regex and applied it to the signing trigger in Djigzo and it threw an error again:

03 Aug 2012 14:49:59 | WARN Invalid pattern. Trigger: (?i)(subject\s:\s\[sign\].*)|(x-secure-sign\s:\strue) (mitm.application.djigzo.james.matchers.SenderHeaderTrigger) [Spool Thread #3]
java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 11
\s\[sign\].*)|(x-secure-sign\s:\strue)

Bizarre! ;(

···

Subject : [sign] test
--
Thanks, Phil

----- Original Message -----

Still unable to get this to work :frowning: What JAVA package does Djigzo use
for its regex ? Wondering if there is a way of testing outside of
Djigzo.
--
Thanks, Phil

----- Original Message -----
> Still the same:
>
> 02 Aug 2012 09:56:02 | WARN Invalid pattern. Trigger:
> (?i)(^subject
> \:\s\[sign\]|^x-secure-sign \:\strue$)
> (mitm.application.djigzo.james.matchers.SenderHeaderTrigger)
> [Spool Thread #3]
> java.util.regex.PatternSyntaxException: Unmatched closing ')' near
> index 34
> \s\[sign\]|^x-secure-sign \:\strue$)
>
> I also tried double bracing the regex from examples I have see
> on-line for groupings:
>
> (?i)(^subject \:\s\[sign\])|(^x-secure-sign \:\strue$)
> --
> Thanks, Phil
>
> ----- Original Message -----
> > Can you try to see whether escaping: works (I.e., using \: )
> >
> > Kind regards,
> >
> > Martijn Brinkers
> >
> > ---
> > Sent with DJIGZO for Android. Please excuse my brevity.
> >
> > ----- Original message -----
> > Am attempting to use the following signing regex trigger:
> >
> > (?i)(^subject :\s\[sign\]|^x-secure-sign :\strue$)
> >
> > but when I review the log file I am seeing:
> >
> > 02 Aug 2012 09:25:03 | WARN Invalid pattern. Trigger:
> > (?i)(^subject
> > :\s\[sign\]|^x-secure-sign :\strue$)
> > (mitm.application.djigzo.james.matchers.SenderHeaderTrigger)
> > [Spool
> > Thread #0]
> > java.util.regex.PatternSyntaxException: Unmatched closing ')'
> > near
> > index 33
> > \s\[sign\]|^x-secure-sign :\strue$)
> > ^
> > The braces match so am missing why the parser believes they are
> > unmatched ?
> >
> > --
> > Thanks, Phil
> >
> > _______________________________________________
> > Users mailing list
> > Users(a)lists.djigzo.com
> > http://lists.djigzo.com/lists/listinfo/users
> >
> >
> _______________________________________________
> Users mailing list
> Users(a)lists.djigzo.com
> http://lists.djigzo.com/lists/listinfo/users
>
_______________________________________________
Users mailing list
Users(a)lists.djigzo.com
http://lists.djigzo.com/lists/listinfo/users