Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following:

Foe every Muslim lady, the general principle in fiqh is to go by the regular pattern you had in your early days unless it is the same in color and texture as menses, in which case, you are to observe a maximum of fifteen days as days of menses. But if the pattern is all disrupted, you simply refrain from Prayer and fasting only when you experience menstruation; as soon as it stops, you should resume Prayer and fasting after proper ghusl.
If, on the other hand, your bleeding has nothing to do with menses, then it is considered as istihadah (which is abnormal bleeding). The rules of istihadah are different from that of hayd (menstruation). In the case of istihadah, you must stay away from Prayer and fasting only during the days of menses (your pattern of six or seven days as you had experienced prior to the start of this abnormal bleeding will be taken as the standard) and then bathe yourself and start Prayer and fasting, but you must wash yourself for each Prayer and perform ablutions (wudu’) for each one. You must resume your fast, as well, soon afterwards.
In deciding whether the blood is menstrual or not you must also refer to your family physician.
Finally, you need not be overly distressed on this fact, for as you have done the best based on sound judgment, following proper procedures, you are excused if you happen to slip up. Allah is forgiving and He does not take us to task for what is beyond our strength to bear.