Core Issue
Border Gateway Protocol (BGP) uses regular expressions for route filtering based on the Autonomous System (AS) path attribute. Regular expressions can be built using letters (A through Z, a through z), numbers (0 through 9) and other keyboard characters, including the question mark (?) character. A regular expression with the (?) character might not be successfully configured because Cisco IOS Software interprets the (?) character as a help command.
Resolution
To prevent the question mark from being interpreted as a help command while configuring regular expressions with the question mark (?) character, press the Ctrl and v keys before entering the question mark.