Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augment and simplify regexes in alcatel_aos_sh_int_ethernet #1966

Merged
merged 7 commits into from
Jan 9, 2025

Conversation

mjbear
Copy link
Contributor

@mjbear mjbear commented Jan 7, 2025

Tweaks to PR #1946

  • Convert trailing $$ to single $ in index
  • Consolidate regexes
  • Remove extra blank line
  • Convert some regexes from \s* to \s+ where possible
    • There are instances in front of colons where a space may not be present so those are left as \s*
  • Simplify \S.+\S regex to .+? for several capture groups

mjbear added 5 commits January 7, 2025 15:54
from alcatel_aos_show_interfaces_ethernet since other
index entries aren't set up that way
* Combine two chassis/slot/port regexes into one
* Reduce SFP/SFP+/XFP regex with a modified pattern
* Add flexibility to odd bandwidth capitalization
* Swap some regex from zero or more (*) to one or more (+)
* Identified common instances where whitespace before colons vary!
* Fix self-induced broken index parsing
@mjbear
Copy link
Contributor Author

mjbear commented Jan 7, 2025

Hehe, I see what you did there in the index 🫠 ... there was a reason for the trailing $ to anchor the command match.

@evilmonkey19 @jmcgill298
In case either of you would like to review or have opinions on my tweaks.

* almost missed simplifying this one, haha
@mjbear mjbear marked this pull request as ready for review January 7, 2025 23:27
@evilmonkey19
Copy link
Contributor

I'm sorry about the index 😢 . It looks cool to me the changed you did 👍 Thanks!

@jmcgill298 jmcgill298 merged commit 784e3fa into networktocode:master Jan 9, 2025
10 checks passed
@mjbear
Copy link
Contributor Author

mjbear commented Jan 10, 2025

I'm sorry about the index 😢 . It looks cool to me the changed you did 👍 Thanks!

All good.
I learned a lesson about the index, hehe.
There was a bit of horror when the tests failed, but once I figured it out I chuckled to myself.

@mjbear mjbear deleted the aos_sh_int_eth branch January 10, 2025 00:52
mjbear added a commit to mjbear/ntc-templates that referenced this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants