Check if CallerID contains set of numbers


I am searching for an easy way to check if a Callerid (number) contains one or more characters.

For example, I would like to know if the CallerID 123456789 contains the range “5678”.

In this case it does.

How can i check (with a dialplan function) if a set of characters is present in a CallerID ?

There is no function CONTAINS I presume ? That would be the best !

Have you tried the ‘=~’ operator?

ExecIf($["${CALLERID(NUM)})" =~ “5678”]?Playback(tt-monkeys)