# unrecognized rule in lex when using ‘|’ (or) regex

I’m making a program that identifies keywords, identifiers, int, float and operators with Lex, but I keep getting errors even though there’s nothing wrong with it. below is my code. (file name is d.l)

In the 6th line, if it is one of several keywords, the keyword is output, so | is used as a regular expression for or.

%%
[_a-zA-Z][_a-zA-Z0-9]{0,30} printf("identifiern");

d.l:6: unrecognized rule