Is there any way to do completely reverse matching of regex what I use.
(?!...) is working only for simple pattern. I means I have a RegEx to match multiple formats, but I wanted to replace everything in a string except my multi formats.
Say for example: I wrote a complex RegEx pattern to find week days, hours, months, years. Instead of finding these matches and splitting my string using these pattern and joining everything that matches; if there is a inverse matching I could just replace it single shot.
The solution given in How to "inverse match" with regex? is not supporting everything.
Example
hr = """
Monday: 11:30am - 9:30pm Tuesday: 11:30am - 9:30pm
Wednesday: 11:30am - 10:00pm Thursday: 11:30am - 10:00pm 
Friday: 11:30am - 10:30pm Saturday: 11:00am - 10:30pm
(brunch served until 3pm) Sunday: 10:30am - 9:30pm (brunch served until 3pm)
Happy Hour and Special Appetizer menu starting at $3 in the bar. Hours from 4 - 7pm Daily.
$4 BURGER special available on Monday. Wednesday: 1/2 off all bottled wines (4-close)"""
import re
newStr = []
dayPattern = """
   (?:mon|tue|wed|thu|fri|sat|sun|thurs)(?:day)?(?:[.:])*
   \s*
   (?:\d{1,2}(?:[:]\d{1,2})?)\s*(?:[ap][.]?m.?) # Start hour
   \s*[-|to]+\s*
  (?:\d{1,2}(?:[:]\d{1,2})?)\s*(?:[ap][.]?m.?) # Close   hour
 """
newStr.extend(\
    re.findall(re.compile(dayPattern, re.VERBOSE|re.IGNORECASE), hr))
print " ".join(newStr)
OUTPUT
Monday: 11:30am - 9:30pm  Thursday: 11:30am - 10:00pm  Friday: 11:30am - 10:30pm  Sunday: 10:30am - 9:30pm
But here I am missing "Monday: 11:30am - 9:30pm Tuesday: 11:30am - 9:30pm Wednesday: 11:30am - 10:00pm Thursday: 11:30am - 10:00pm Friday: 11:30am - 10:30pm".
I could modify my regex to include this pattern too
But instead of doing like this, is there a way I can remove any word except Monday/Tuesday/.... & Mon/Tue/Wed... & 11:00am/12pm...
i.e, exactly I want is this output:
Monday: 11:30am - 9:30pm Tuesday: 11:30am - 9:30pm Wednesday:
 11:30am - 10:00pm Thursday: 11:30am - 10:00pm Friday: 11:30am - 10:30pm
 Saturday: 11:00am - 10:30pm Sunday: 10:30am - 9:30pm