Messaging Gateway

 View Only
  • 1.  Regular Expression match on subject line

    Posted Mar 11, 2008 10:40 AM
    I have been experimenting with regular expression matches on the subject line and the from field. However i cant seem to get anythnig to match.

    I have a policy that test invalid character sets but i still get them coming in. Any ideas?

    If the Subject matches regular expression ".*=\?(koi8-r|iso-2022-jp|windows-1251|Big5)\?"


  • 2.  RE: Regular Expression match on subject line

    Posted May 16, 2008 02:54 PM
    Hi,
    There's a great little program out there called "RegexBuddy" that tests your Regex string.
    I copied your string into it (minus the quotes I assume) and this is the interpretation it gave.
    Maybe this will help you determine if your really matching your intended subject.
    Looks like it's looking for =?subject? literaly.
    - ioPro
     
    .*=\?(koi8-r|iso-2022-jp|windows-1251|Big5)\?
     
    Match any single character that is not a line break character «.*»    Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
    Match the character “=” literally «=»
    Match the character “?” literally «\?»
    Match the regular expression below and capture its match into backreference number 1 «(koi8-r|iso-2022-jp|windows-1251|Big5)»   
    Match either the regular expression below (attempting the next alternative only if this one fails) «koi8-r»
    Match the characters “koi8-r” literally «koi8-r»    Or match regular expression number 2 below (attempting the next alternative only if this one fails) «iso-2022-jp»       Match the characters “iso-2022-jp” literally «iso-2022-jp»    Or match regular expression number 3 below (attempting the next alternative only if this one fails) «windows-1251»       Match the characters “windows-1251” literally «windows-1251»    Or match regular expression number 4 below (the entire group fails if this one fails to match) «Big5»       Match the characters “Big5” literally «Big5»
    Match the character “?” literally «\?»
     
    Created with RegexBuddy


  • 3.  RE: Regular Expression match on subject line

    Posted Dec 26, 2008 11:01 AM

    On Windows platform, I use biterscripting. It can match

     

    one printable char
    one nonprintable char
    one any char
    one from a set of chars
    one NOT in a set of chars
    any number of printable chars
    any number of non-printable chars
    any number of any chars
    a fixed string
    a fixed char
    etc. (I am not sure I remember all of them.)

     

    Sen