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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

VCS Regex help, Matching on anything that Doesn't lead with 11 or more digits

Hello,

 

I've created some pretty complex regex in my day but this one has me stumped.

 

In an effort to stop toll fraud attempts, I would to change a search rule on my VCS-E from "any alias" to a regex which will match "anything that does not lead with 11 digits".

 

First I tried with: [^\d{10,}] but you can't use special characters inside the [] as they are taken literally.

So 

I've tried using the Negative lookahead: (?!\d{11,}) and tried with the ^ in there: (?!^\d{11,})

No luck there either.

 

Any ideas?

 

 

Everyone's tags (1)
7 REPLIES
VIP Purple

Do you want to limit the

Do you want to limit the number 11 specifally, or any repitition of the number 1?

I just tested, and if you want to prevent calls from just the number 11, you can use (?!11).*, it's a negative lookahead.  if you want to limit a scope of numbers, than it might take some more work, that is if it's possible.

New Member

Patt, I'm not looking to

Pat,

Thanks for your reply.

 

I'm not looking to limit the number 11 or 1, but rather 11 or more digits.

So a dial of 1234567890@domain would pass the traversal zone, but a dial of 12345678901@domain would not.

 

Right now I set a transform to match on anything 11+ digits: \d{11,}.* and replace with TollFraud

Then in my traveral search rule I use the forward lookup (?!TollFraud).* to skip anything that leads with TollFraud.

It works but I wanted it to be cleaner with a single rule. 

VIP Purple

You can try setting your

You can try setting your search rule to use (?!\d{11}).*, this will match anything that is under 10 numbers, anything 11 or over the match will fail.  Since the match will fail, it should prevent the search.

New Member

Ah!I figured it out!(?!\d{11,

Ah!

I figured it out!

(?!\d{11,}).*

 

Looks like I needed the .* on the back to match the rest of the dial attempt, doh!

 

Thanks!

VIP Purple

Good!  You beat me to it, I

Good!  You beat me to it, I hit reply right as your message came in.
 

VIP Purple

Remove the , that is in your

Remove the , that is in your regex though.

(?!\d{11,}).*

New Member

I need the , as {11} is 11

I need the , as {11} is 11 and {11,} is "11 or more" which I learned today from:

http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/

 

69
Views
0
Helpful
7
Replies
CreatePlease login to create content