I am dealing with a patient day calendar with time slots.
Each hour is divided into two equal time slots.
If the person is available for the whole 1 hour it is is denoted as 11
If not available for the whole hour : 00
Available for first half only : 10
Available for second half only : 01
So the entire calendar of the patient has 48 digits
But for now, just to ease things, we will assume we are looking from 12AM to 6AM only.
So the calendar will be [01]{12}
Suppose the patient is available from 12AM to 3AM and 4AM to 6AM.
Now his calendar can be marked as
111111001111
Now the doctors' calendar is also stored in the similar way
Now suppose the appointment window is fixed as 1 hour, I need to find all the doctors has a 1 hour available timeslots within patient's available timeslot
The doctors' availability outside the patient's available time doesn't matter, ie in this case 3AM to 4AM
Basically, I want to write a regex to match all those
Hello, I am an expert in Regex, I handle advanced concepts (negative / positive lookaheads / lookbehinds, capturing groups, etc.) You can contact me to share information. Greetings.