Loading ...
Sorry, an error occurred while loading the content.

535Can a Reg Exp handle 123 AND not a|b|c followed by x?

Expand Messages
  • mycroftj
    May 9, 2012
      Is there a relatively simple reg exp to find the following?

      Date in format mm/dd/yyyy OR yyyy/mm/dd followed by a space followed by an open paren followed by three characters that are *NOT* MON|TUE|WED|THU|FRI|SAT|SUN followed by a closing paren?

      I've gotten as far as the following that does all the above except for checking for the closing paren.

      ^!Find "(?:(\d\d/\d\d/(?:19|20)\d\d)|((?:19|20)\d\d/\d\d/\d\d))\x20\((?!(MON|TUE|WED|THU|FRI|SAT|SUN))" RSTI

      Note: (?: is for a non-capturing group

      Example:

      05/12/1995 (Fri) <-- This should not match
      05/13/1995 (Sat) <-- This should not match
      05/14/1995 (zzzday) <-- This should not match
      05/15/1995 (Mox) <-- ***This should match***
      05/16/1995 (Tue) <-- This should not match
      05/17/2005 (Tue) <-- This should not match

      I did get the clip working using the above FIND and a few extra lines, but now I'd like to know if this is (easily) possible to do with one FIND.

      Thanks!

      Joy
    • Show all 13 messages in this topic