04-11-2022 01:28 PM
Hello
I have a customer who has decided to use a location prefix and a function suffix for AP naming on their Cisco 9800.
For example:
EU-Site2-AP20-Root
EU-Site2-AP21-MAP
I am now trying to create AP-filters for this and i want to match on:
"Site2" and "Root" in AP filter rule 1
"Site2" and "MAP" in AP filter rule 2
I am not skilled at all in REGEX, so i can only do the basics like ^ for matching the beginning of a string, $ for matching the end of a string, | for matching one or the other etc.
Basically, can someone help me create a one-liner REGEX with an "AND" operator, that will work in 9800?
"?" as a character is not allowed for REGEX in the 9800... Not in the GUI at least...
Best Regards
Frederik
Solved! Go to Solution.
04-12-2022 03:47 PM
Try this one then
((Site2).*(Root))
Replace the Site2 and Root with the site and mesh type
04-11-2022 03:09 PM
Try this:
^(?=.*\bSite2\b)(?=.*\bRoot\b).*$
Replace Site2 and Root with the 2 variables you wish to match
The expressions in parentheses starting with ?= are the positive lookaheads. I'll break down the pattern:
Useful Regex tester here https://regex101.com/
04-12-2022 01:06 AM
Hello Haydn
Thank you for your reply!
Have you had the possibility to try out that REGEX on a Cisco 9800 WLC?
I have tried using "?" as a character in my REGEX, but the Cisco 9800 WLC will not accept "?" as a character, because ? is used in the syntax for CLI to look up command possibilities like "Show ip ?" to look up the possible keywords to use after "Show ip"...
- So if you try and use ? in your REGEX, you will get an error like the on the attached screenshot...
Do you know if there is another way of doing it, that doesn't involve "?" as a character?
Best Regards
Frederik
04-12-2022 03:47 PM
Try this one then
((Site2).*(Root))
Replace the Site2 and Root with the site and mesh type
04-13-2022 02:23 PM
Hello Haydn
Again, thank you for your reply!
The 9800 seems to be OK with that REGEX one-liner!
I will try it out once I am back at the customer site and able to test
Best Regards
Frederik
04-21-2022 03:24 AM - edited 04-21-2022 03:25 AM
Hello Haydn
I have now had the chance to test out the above mentioned REGEX one-liner in the customer environment...
- And it works!
So now i have successfully configured all the RAP's and MAP's using separate rules from the rules configuring the AP's inside the building and all AP's are getting the correct tags!
Thank you very much for your help!
Best Regards
Frederik
04-18-2022 04:38 AM
What version of code? Have you tried 17.6.3? (not that I know of any specific fix but lots of general improvements)
Also try using the original in quotes ""
Try configuring on CLI? (again also using quotes)
Also note there's an enhancement (feature request) bug raised https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvz84973
04-18-2022 08:46 PM
Hello rrudling
Unfortunately i cannot upgrade past 17.3.x, since the customer still has some 2702 AP's which has to be taken into consideration.
I have not tried to configure the REGEX using CLI or ""
That feature request you have highlighted seems to be wanting to do the almost the same as i am trying to do
- Thanks! I will keep an eye out for this feature request to see if it gets a solution.
I will get back about the REGEX once i have had time at the customer during the week.
Best Regards
Frederik
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide