Thanks for your question.
If you hold a residence card, divorce and meet the following criteria then you will retain a right of residence in the UK until the expiry of your residence card following your divorce and can apply to have this acknowledged by the UKBA:-
6.1 Retention of the right of residence following divorce or annulment of marriage/dissolution of civil partnership
A person who ceases to be a family member of a qualified person on termination of a marriage or civil partnership will retain a right of residence if:
• the marriage or partnership lasted for at least three years immediately before the initiation of proceedings for divorce, annulment or dissolution, and
• the parties to the marriage or civil partnership had resided in the UK for at least one year during the duration of the marriage or civil partnership, or
• the former spouse or civil partner of the qualified person has custody of the children or a right of access to the children in the UK, or
• there are particularly difficult circumstances (such as domestic violence) justifying the retention of the right of residence.
In such circumstances a family member retains a right of residence if:
(a) S/he is a non-EEA national but is pursuing activity which would make him/her a worker or a self-employed person if s/he were an EEA national,
(b) S/he is a self-sufficient person, or
(c) S/he is the family member of a person in the UK who is either a worker, self-employed, or is a self-sufficient person.
See Regulation 10(5) of the 2006 Regulations for more information.
You will see that the above is contained in the following UKBA document:-
If you were married and continued to have a relationship of a married couple then you could apply for PR after 5 years.
If you are not in a relationship at the time of reaching 5 years then it will be difficult because the application should be supported by your (ex)wife. If she does this and you are both able to prove that although you are divorced you have exercised your treaty rights in the UK for at least 3 of the 5 years then you should receive PR
If this has been useful please kindly click accept so that I may be rewarded for my time. If you do not click accept your money stays with the site and I do not receive any credit for the time I have taken to answer your question.
I will answer your follow up questions you may have.