He divorced her via text message several times, and when she was menstruating, and when he was angry
Question

                I am from American and I have a question about my marriage.

I got married three years ago, very ignorant about "talaq" and how many times your supposed to say it and when you are suppose to say it. Somebody told me that I am suppose to say it three times in order to get divorced with someone and in my mind I thought you were suppose to say it three times in one sitting in order to divorce your spouse.

The first time I said it was with text message and this was when my wife was in India and I cant exactly remember why I text her and I text her twice, talaq. I also cannot remember if I intended divorce or not towards her. Her brother asked a Hafiz and he said the text message is invalid it does not count.

I also said it two differnet times and both times I was angry to the point where I really had a hard time controlling my behavior. The first time I said it two times and the second time I said it three times.

I also read online about menstruation and that talaq is invalid during menstruation.

Another thing I would like to state is that me and my wife always had sexual relations between each menstrual cycle and I also saw a video online posted by a scholar that a man cannot have sexual intercourse with his wife and divorce her when he wakes up because he still has feelings for her.

In addition, I also have doubts about the implicit divorces and what exactly what my intention was when I said it.

My wife saying were still married because she did not hear me tell her talaq when I was angry and that we need witnesses.

Recently, I came across Hanifa fiqh of divorce online and one scholar said if you say it 3 times, you guys are divorced but I was reading fatwa at the same time from your website and it said otherwise.

Can you please clear up my doubts and confusion.
Praise be to Allah.
    Firstly: 

    Divorce issued in writing or via e-mail or text message 
    counts as such so long as the intention to divorce is present or it is 
    accompanied by signs that point to intention to divorce. 

    But if that is written in order to show his handwriting or 
    with the intention to make his wife worry, but without the intention to 
    divorce her, then it does not count as such. 

    But if you are uncertain about your intention when you wrote 
    the message, or you forgot what your intention was, the divorce does count 
    as such. 

    See the answer to question no.
    72291 

    In order for divorce to be valid, it is not stipulated that 
    the wife should hear it or that witnesses should be present. 

    Secondly: 

    Divorce during the wife’s menses or during a period of purity 
    in which a man has had intercourse with his wife, does not count as such 
    according to the more correct opinion. See the answer to question no.
    72417 

    Thirdly: 

    Divorce issued in a state of extreme anger does not count as 
    such. See the answer to question no.
    96194

    The threefold divorce counts as one divorce, according to the 
    more correct opinion, whether one says: “You are divorced, you are divorced, 
    you are divorced”, or he says: “You are thrice divorced” or “You are 
    three-times divorced.” 

    If a man divorces his wife and she begins the ‘iddah, then he 
    divorces her again before taking her back, the second divorce does not count 
    according to the more correct opinion, because divorce can only be valid 
    after doing the marriage contract or after taking the wife back. 

    Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: The 
    more correct view concerning this entire issue is that there is no threefold 
    divorce at all, unless he issues a divorce then takes her back, or makes a 
    new marriage contract  otherwise the threefold divorce does not count as 
    such. This is the view favoured by Shaykh al-Islam Ibn Taymiyah (may Allah 
    have mercy on him), and it is the correct view. End quote from ash-Sharh 
    al-Mumti‘, 13/94 

    Based on the above, you can work out the number of divorces 
    that you issued. 

    Husbands have to fear Allah, may He be exalted, and not take 
    the verses of Allah in jest, or toy with divorce and use it for purposes 
    other than those for which it was ordained. 

    And Allah knows best.