Check if CallerID contains set of numbers

Hello

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?

wiki.asterisk.org/wiki/display/AST/Operators

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