There are many narrations where the Allah's Apostle (salallahu alayhi wassalam) mentions "flag" like the following one:
Narrated Anas:
The Prophet had informed the people of the martyrdom of Zaid, Ja'far and Ibn Rawaha before the news of their death reached. The Prophet said, "Zaid took the flag (as the commander of the army) and was martyred, then Ja`far took it and was martyred, and then Ibn Rawaha took it and was martyred." At that time the Prophet's eyes were shedding tears. He added, "Then the flag was taken by a Sword amongst the Swords of Allah (i.e. Khalid) and Allah made them (i.e. the Muslims) victorious." Sahih Al-Bukhari Book 64, Hadith 4307
Wiki says "An Islamic flag is a flag that complies with Islamic rules."
My question is "Does Islam have a flag?" and "What are the rules for the flag?"
Answers with scholarly opinion based on Qur'an and Hadith preferred.