We have been down for nearly a week as a result of a DDoS. We needed to switch providers. We apologize for any inconvenience this may have caused.
There may be some bugs which occur as a result of the move. Please let us know if you find any.
Thank you --Robin 21:14, 15 July 2008 (UTC)
Testing Regex Expressions
From CastleCopsWiki
|
MailWasher Pro Index
|
[edit] Testing Tools
Regular Expression filters can be difficult to debug. MWP provides a rudimentary filter test facility. Via the Edit Filter window, there is a small, button labeled "..." only for regex expressions though. Click it to open the Regular Expression Tester window. The regex appears in the top window so just paste in the msg segment to be tested.
This test facility is somewhat limited though. Thankfully the TRegExpr library used by MWP comes with a test tool, Testrexp. Download TRegExpr Ver. 0.947 for use with MWP.
Users are better off downloading and using the same engine that MWP uses, in order to test the expressions. Other Regular Expression Engines may not yield the same results.
After installing the TRegExpr program and running it, note the 'Global Modifiers' checkboxes at the top of the 'Expressions' page of the program. In order to have 'TRegExpr' run with the same defaults as are used by MWP, one must set these modifiers as follow:
- \i - ON (checked)
- \m - ON (checked)
- \s - ON (checked)
- \x - OFF (unchecked)
- Greedy - ON (checked)
- Russian Ranges - OFF (unchecked)
These will have to be correctly set each time 'TRegExpr' is opened.
[edit] Testing Strategy
It's best to develop regex filters with the use of a text editor. The first few lines of the file could capture the regex currently in use / development. The remainer of the file can contain selected message headers/bodies used to test the regex via TRegExpr. If a false positive is observed later, the file can be pulled up and then either the message header/body can be added to the file or the regex could be fixed depending on time factors and whether enough clues have been gathered to explain symptoms.
Using this approach solves several problems, including the small filter font issue.
