I'm trying to do some regex matching in the Junos CLI, like show configuration | match "fancy.pants(reg|ex)". I especially want to look for word boundaries and other character classes. I'm used to \b, \d, etc. in PCRE-ish regex, and that doesn't work.

According to Juniper's docs:

Juniper Networks uses the regular expressions as defined in POSIX 1003.2.

For the life of me, I cannot find any documentation of the actual 1003.2 standard. I have found a thousand pages explaining regex flavors, but none seem complete or authoritative.
They lead me to understand that POSIX 1003.2 defines Basic and Extended Regular Expressions (BRE & ERE). From experimentation, it seems that the Junos CLI respects at least some Extended features.

So does Junos CLI matching use ERE specifically?
And is there an official standard to reference?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 25, 2018 at 9:01
  • 2
    This guy is about the most expert in all the various regular expression dialects as anyone around. Apparently, the POSIX regex is quite limited. See the link. His RegexBuddy is a fantastic tool that supports building regular expressions and using them in various programming environments and systems.
    – Ron Maupin
    Oct 5, 2022 at 0:30
  • 2
    Sadly, the IEEE 1003.2d-1994 standard is not free and needs to be purchased: standards.ieee.org/ieee/1003.2d/1415
    – Zac67
    Oct 5, 2022 at 4:50

1 Answer 1


This is a draft I have found of the standard (1003.2), see pages 128 onwards


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.