I think it’s a crap shoot. Here’s a number of formats found in the literature:
Twenty-First Alabama Infantry Regiment
21st Regiment, Alabama Infantry
21ST ALABAMA INFANTRY
21ST ALABAMA REGIMENT
The 21st Alabama Volunteers CSA
THE TWENTY FIRST ALABAMA INFANTRY.
This regiment was organized in Mobile in October, 1861, and
served that winter at Mobile.
Report of Lieut. Col. S. W. Cayce, Twenty-first Alabama Infantry.
HDQRS. TWENTY-FIRST REGT. ALABAMA VOLS., Corinth, Miss., April 13, 1862.
SIR: I have the honor to submit annexed a tabular statement of the loss
sustained by my command [Twenty-first Alabama Volunteers] in the late
battle near Monterey, on the 6th and 7th instant, amounting in the
aggregate to 198 killed, wounded, and missing.
..
When the enemy's fleet passed into the bay the garrison consisted of two
companies of Twenty-first Alabama Regt.
…..
From the Official Records:
Having formed the brigade in line of battle, as ordered [the Twenty-first Alabama on the right, the Second Texas in the center, and the Nineteenth Alabama on the left]
Fort Gaines was garrisoned by six companies Twenty-first Alabama Regiment,
Col. C. D. ANDERSON commanding. 21st Alabama Infantry, First Battalion.
THOMAS' BRIGADE.
21st Alabama, Lieutenant Colonel James M. Williams.