Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Help with RegEx to extend (?!.*@%localdomains%).*

Hi All,

I have been looking over some previous discussions (such as, documentation (such as - which is very good BTW), and RegEx sites to see if I can com up with something to work for us.

The RegEx :


is used on the VSC-E search rule to forward URI lookups that do NOT have a SIP domain configured on the VCS. This is great but assumes that the search string is in a URI format usually accomplished by a transform in the VCS-E. At the moment we don't apply this transform as (in general), we route using the E.164 via the Global Dialling Scheme. In addition, the VCS-E is used as a traversal server to many VCS-C and potentially will host many SIP domains - so which one do I transform to?

The problem I have that without this domain conversion transform, the above RegEx actually matches non URI strings and the DNS search rule will be invoked. A DNS look for such a non domain would obviously fail but is pointless and time/resources consuming.

So I was wondering if ther was a way to construct the RegEx to not only fail when a string contains a domain as configured on the VCS (as above), but ALSO only to succeed when a valid URI is detected - i.e. some thing with an @ in it. I did come up with the following:


but unfortunately this name overrides the main part of the RegEx as, of course, the configured domain used in a URI will also have an @ in them.

E.g. We have two domains configured on the VCS - and

I need to ensure that the RegEx is ONLY true when a string contains a valid URI, but does NOT end in either and

So: -                Fail -          Fail -                     Success

     0123456  -                              Fail

Perhaps (and to maybe answer my own question), I should just add a transform anyway and turn all non URI searches into a configured dummy domain (i.e. I can essentially ignore and strip this if the string contains a transformed E.164 number and route as normal, yet the DNS search rule will be prevented from firing.

Anyhow, thoughts welcome.


Everyone's tags (1)

Help with RegEx to extend (?!.*@%localdomains%).*

To answer my own question (2), if I can out the OR in the RegEx above, it all works.



Re: Help with RegEx to extend (?!.*@%localdomains%).*

Hi Cris,

I didn't even have time to suggest you anything... rsrs.

Five stars to you for answering your own question.   =)


Paulo Souza

Please rate replies and mark question as "answered" if applicable.

Paulo Souza Was my response helpful? Please rate useful replies and remember to mark any solved questions as "answered".
CreatePlease to create content