Checking for function notation f(7)

I want to check that the S entered something like f(7). I can sort of get it to work by using the following.

fpattern = p.product(p.literal(f),p.number).strictOrder

However, it will also validate with f*7. I have tried using literal with parentheses:

fpattern = p.product(p.literal(f),p.lieral((),p.number,p.literal()).strictOrder

But no love. Ideas?

I can (duh) just do fpattern = p.literal(f\left(7\right))

Maybe that’s the best approach??

Seems that way to me. Once Desmos starts accepting function notation in the CL, then you’ll have an alternative.

1 Like