Dialplan to match number string in between

Hello Community,

I need to write pattern for matching if “999997” is there in between the number dialed:

For ex:

399999712345 ----> Should match as it has 3"999997"12345

14999997009988776 ----> Should also match as it has 14"999997"009988776

999997123456 ----> Should NOT match as there is no any number before string 999997

1423456999997 ----> Should NOT match as there is no any number after string 999997

Is this possible? please suggest.

Thanks,
Bhushan

Use a Regex

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_REGEX

Thank you John for your response.