[Tex/LaTex] Different ways to print the exclamation mark symbol

math-modesymbols

I have some problems using the exclamation mark symbol explicitly, so I have to find another way to print it on math mode. I tried to use \usepackage[utf8]{inputenc} but apparently I have to define a new macro and I really don't want to do that. Any advice would be great.

Edit: I have an application that generates a .tex file as output, the input is another file that I have to parse, and ! is as reserved symbol, so I can't put it explicitly.

Best Answer

! is at position hex 21 so you can use ^^21 which will make a ! token just as if a ! had been in the input.