Recognition of the ribonucleic acid 5' termini (RNA 5' cap) by a wide class of cap-binding proteins is largely accomplished by cation-pi stacking that involves the positively charged 7-methylguanine ring and aromatic amino acid side chains. Quantum calculations of the stacking energy were performed by means of MP2 perturbation method for binary and ternary associates composed of the 7-methylguanine moiety and tryptophan, tyrosine, or phenylalanine, in their spatial orientations known from the crystalline cap-protein complexes. The results clearly pointed to an enhancement of the stacking energy due to a net positive charge in the cap guanine moiety and allowed analysis of a role of various amino acids in stabilization of the complexes. Conformational flexibility of the aromatic amino acids taking part in binding ligands to a wide class of RNA-recognizing proteins, including the cap-binding proteins, was determined by regional order neural network (RONN) algorithm that provides results close to those of the crystallographic B-factors analysis. Interestingly, some of the tyrosines that are classified in general as "rigid" showed high flexibility when engaged in binding the cap to nuclear cap-binding protein complex CBC and to viral methyltransferase VP39. Parallel analyses of the binding energy and flexibility of the protein fragments engaged in the binding leads to understanding differences in molecular mechanisms of the cap recognition by various proteins, CBC compared with the eukaryotic initiation factor eIF4E, and enzymes vs. other protein factors.