cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
561
Views
0
Helpful
3
Replies

REGEX ISSUE

Chet Cronin
Level 4
Level 4

Help  

Ok My CMS has seven digit cospaces on it. The CMS is Neighbored to my Expressway. 

When some for example dials 6511806 there is a search replace rule to send 65118(\d{2}) replace with \1@domain.com  to the CMS and works fine.  

Now my issue is someone dialing in 10 digit so I made a rule example:    31165118(\d{2}) and replace 651(\d{2})@domain.com to the CMS.  Does not work. 

The search history show that the rule changes the URI to 65118d{2}@domain.com ?   

I have tried different variations but still not working .. Any help is appreciated.   
Need the rule to remove the 311 forward 65118xx to the CMS. 

Thank you ahead of time.  

Chet Cronin
2 Accepted Solutions

Accepted Solutions

Wayne DeNardi
VIP Alumni
VIP Alumni

In your example above, you match 31165118(\d{2}), and to carry those two digits over, your replace string would need to be 65118\1@domain\.com

If you ever need to test out regex strings, I'd suggest using the regex101 web site: regex101: build, test, and debug regex

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

View solution in original post

Wayne DeNardi
VIP Alumni
VIP Alumni

You should be able to do it in a similar fashion using a Search rule with a regex match instead of the transform and prefix match combo.

Mode: Alias Pattern Match
Pattern Type: Regex
Pattern String: (698437\d(2})@IP
Pattern Behaviour: Replace
Replace String: \1
Target: Site A

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

View solution in original post

3 Replies 3

Wayne DeNardi
VIP Alumni
VIP Alumni

In your example above, you match 31165118(\d{2}), and to carry those two digits over, your replace string would need to be 65118\1@domain\.com

If you ever need to test out regex strings, I'd suggest using the regex101 web site: regex101: build, test, and debug regex

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

Thank.   I have another question about the transforms and search rules.  
My issue is outbound dialing from my CMS >Expressway Core > Neighbor zone. 
Example:  I have Neighbor Zone with Site A (h.323 and SIP TLS port 5061) ,   Neighbor Zone with CMS (SIP TLS Port 5061). 
I want to dial out to a system at site A from the CMS using Cisco Meeting Manager. 
When I dial the 10 digit number it gets to the Expressway as alias@domain and then changes to alias@IP Address of the Expressway. 
Now what need is to strip the address and only forward the digits to the site A. 
I have a transform:  Replace  (698437)(\d(2})@IP Address  to \1\2 
I have a pre search Prefix rule 698437 target site A. 

I don't like using transforms and was trying to create a search rule but to get it working I had to create the transform.  
Any ideas ?

 

Chet Cronin

Wayne DeNardi
VIP Alumni
VIP Alumni

You should be able to do it in a similar fashion using a Search rule with a regex match instead of the transform and prefix match combo.

Mode: Alias Pattern Match
Pattern Type: Regex
Pattern String: (698437\d(2})@IP
Pattern Behaviour: Replace
Replace String: \1
Target: Site A

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.