├── README.md ├── Junos.JSON-tmLanguage └── Junos.tmLanguage /README.md: -------------------------------------------------------------------------------- 1 | junos-sublime-pkg 2 | ================= 3 | 4 | **Junos Config Syntax Highlighting for Sublime Text** 5 | 6 | ### Description 7 | This is a Sublime Text 2/3 package to highlight the syntax for configurations on Juniper Junos (EX, MX, SRX) devices. It will work for configurations both in set mode and stanza form. This syntax will automatically associate to a file with any of these extensions: `.conf`, and `.conf.1` through `.conf.49`. This accounts for the maximum number of rollback configs. To set the syntax for a file ending in any other extension, use the syntax menu in the bottom right, or press Cmd+Shift+P and type `Junos` to set the syntax for an open file. 8 | 9 | ### Installation 10 | The easiest method of installation is using [Package Control](https://sublime.wbond.net/installation). Simply press Cmd+Shift+P and type `pcin` to get to `Package Control: Install Package`, then search for `Junos`. 11 | 12 | To install manually, simply download the lastest release [here](https://github.com/nprintz/junos-sublime-pkg/releases/latest), and drop the two `.tmLanguage` files into your `Packages/User` folder. The Packages folder can be found by going to the `Sublime Text 2` > `Preferences` > `Browse Packages` menu option. 13 | 14 | ### Matches 15 | Name | Description 16 | ------|------------ 17 | Comment Block or Annotation | For annotations in stanza mode: `/* Some Text */` 18 | Control Keywords | Highlights set/stanza mode keywords (`set`, `delete`, `activate`, `protect`, `inactive:`, `edit`, `show`, etc) as keyword.control.junos 19 | Interface names | Highlights interface names, and their corresponding unit numbers if in shortened format (ge-0/0/0.12) 20 | IPv4 and IPv6 addresses | All IP addresses get highlighted as a number 21 | Line Comment | Anything after a number sign, `#`, on a line 22 | MAC addresses | All MAC addresses get highlighted as a number 23 | Major Sections | Matches major sections of the config. For example, `system`, `interfaces`, `routing-instances`, are all major categories (entity.name.function.junos) 24 | Minor Sections | Same as major sections, just for more of the less common sections of Junos config 25 | Policy Actions | Denial Actions (deny, reject, discard) are highlighted as invalid.illegal.junos. Acceptance actions (accept, permit) are highlighted as constant.language.junos. 26 | Routing Tables | Routing Table names are captured as a control keyword (inet.0, mytable.inet.2, mpls.0, etc) 27 | Strings | Anything between single- or double-quotes ( ' or " ) gets marked as a string. This also includes any word block after the keyword `description`, which may not be quoted 28 | Unit numbers | Unit numbers get highlighted as a number 29 | URLs | Any http://, https://, ftp://, tftp://, sftp://, or scp:// URL string will be highlighted as an operator. This includes IPv4 addresses (i.e. http://10.0.0.10/index.php) 30 | User defined arbitrary names | These get highlighted as a variable. Examples include the names of logical-systems, filters, prefix-lists, policies, NAT rules, security zones, policers, etc 31 | 32 | ### Examples 33 | Examples with the built-in `Twilight` color scheme: 34 | 35 | Set mode: 36 | ![Set Mode](https://cloud.githubusercontent.com/assets/7231007/3803665/5fb3e326-1c1d-11e4-80fd-9b222f8a1abf.png) 37 | 38 | Stanza mode: 39 | ![Stanza Mode](https://cloud.githubusercontent.com/assets/7231007/3803687/81b640e0-1c1d-11e4-9dd6-f228e4c4275d.png) 40 | -------------------------------------------------------------------------------- /Junos.JSON-tmLanguage: -------------------------------------------------------------------------------- 1 | { "name": "Junos", 2 | "scopeName": "text.junos", 3 | "fileTypes": ["conf", "conf.1", "conf.2", "conf.3", "conf.4", 4 | "conf.5", "conf.6", "conf.7", "conf.8", "conf.9", 5 | "conf.10", "conf.11", "conf.12", "conf.13", "conf.14", 6 | "conf.15", "conf.16", "conf.17", "conf.18", "conf.19", 7 | "conf.20", "conf.21", "conf.22", "conf.23", "conf.24", 8 | "conf.25", "conf.26", "conf.27", "conf.28", "conf.29", 9 | "conf.30", "conf.31", "conf.32", "conf.33", "conf.34", 10 | "conf.35", "conf.36", "conf.37", "conf.38", "conf.39", 11 | "conf.40", "conf.41", "conf.42", "conf.43", "conf.44", 12 | "conf.45", "conf.46", "conf.47", "conf.48", "conf.49" 13 | ], 14 | "patterns": [ 15 | { 16 | "comment": "Block Comment or annotation", 17 | "name": "comment.block.junos", 18 | "begin": "/\\*", 19 | "end": "(\\*/|\n)", 20 | "captures": { 21 | "0": { "name": "comment.block.junos" } 22 | } 23 | }, 24 | { 25 | "comment": "Line comment, anything following a hashtag (#)", 26 | "name": "comment.line.number-sign.junos", 27 | "match": "(^|^\\s|\\s)(#).*$\n?", 28 | "captures": { 29 | "2": { "name": "punctuation.definition.comment.junos" } 30 | } 31 | }, 32 | { 33 | "comment": "sections that have a user-defined sub-item, but modified to capture in stanza mode. Had to be its own capture, since it covers multiple lines.", 34 | "begin": "(?<=^|\\s)(apply-groups|groups|access-profile|vlans|bridge-domains|routing-instances|dynamic-profiles|jsrc-partition|logical-systems)(?:\\s{\\s*)", 35 | "beginCaptures": { 36 | "1": { "name": "entity.name.function.junos" } 37 | }, 38 | "end": "\\s{|;", 39 | "patterns": [ 40 | { "name": "variable.language.junos", 41 | "match": "[-\\w_<>:\\./]+" 42 | } 43 | ] 44 | }, 45 | { 46 | "comment": "Major sections of the configuration", 47 | "match": "(?<=^|\\s)(system|forwarding-options|routing-options|routing-instances|logical-systems|vlans|bridge-domains|dynamic-profiles|interfaces|snmp|poe|ethernet-switching-options|security)(?=[ \n;])", 48 | "captures": { 49 | "1": { "name": "entity.name.function.junos" } 50 | } 51 | }, 52 | { 53 | "comment": "minor sections of the config.", 54 | "match": "(?<=^|\\s)(policy-options|protocols|chassis|firewall|applications|multi-chassis|redundant-power-system|version|services|virtual-chassis|event-options|class-of-service|access|accounting-options|diameter|fabric|multicast-snooping-options|switch-options|wlan|smtp|schedulers)(?=[ \n;])", 55 | "captures": { 56 | "1": { "name": "entity.name.function.junos" } 57 | } 58 | }, 59 | { 60 | "comment": "keywords captured without a major/minor section attached", 61 | "name": "keyword.control.junos", 62 | "match": "(?<=^|\\s)(set|request|delete|edit|show|protect:?|inactive:|unprotect|deactivate|activate)(?= )" 63 | }, 64 | { 65 | "comment": "Policy/filter denial/rejection actions", 66 | "name": "invalid.illegal.junos", 67 | "match": "(?<=\\s)(deny|discard|reject)(?=\\s|;|$)" 68 | }, 69 | { 70 | "comment": "Policy/filter accept/permit actions", 71 | "name": "constant.language.junos", 72 | "match": "(?<=\\s)(accept|permit)(?=\\s|;|$)" 73 | }, 74 | { 75 | "comment": "Interface names", 76 | "name": "support.class.junos", 77 | "match": "\\b((((ge|et|so|fe|gr|xe|lt|vt|si|sp)(-\\d+\/\\d+\/\\d+))|(st|lo|me|vme|ae|reth)\\d{1,3}|irb|vlan)(\\.\\d{1,5})?)\\b(?![-_<>])" 78 | }, 79 | { 80 | "comment": "IPv4 addresses, with or without a mask", 81 | "name": "constant.numeric.integer.long.octal.junos", 82 | "match": "\\b((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))([/]\\d{1,2})?\\b" 83 | }, 84 | { 85 | "comment": "MAC Addresses identified as a number", 86 | "name": "constant.numeric.integer.long.octal.junos", 87 | "match": "(?:(\\b))([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})([/]\\d{1,2})?\\b" 88 | }, 89 | { 90 | "comment": "Unit numbers, port numbers, etc", 91 | "match": "(?:\\s(?:(?:peer-)?unit|queue(?:-num)?|destination-port|source-port)[ ])((\\d{1,5})(-\\d{1,5})?)(?=[;]|$|\\b)", 92 | "captures": { 93 | "1": { "name": "constant.numeric.integer.long.octal.junos" } 94 | } 95 | }, 96 | { 97 | "comment": "URL Addresses, either matching character URL patterns, or http(s):// followed by an IPv4 address. ", 98 | "name": "keyword.operator.junos", 99 | "match": "\\b((https?:)|(scp:)|((s?|t?)ftp:))\/\/((([\\da-zA-Z\\.-]+)\\.([A-Za-z\\.]{2,6}))|(\\b((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\b))(([\/\\w\\.&?=+-]*)*)\/?" 100 | }, 101 | { 102 | "comment": "Routing table names", 103 | "name": "keyword.operator.junos", 104 | "match": "(?<=\\s)([\\w\\d_-]+\\.)?(inet6?|mpls|inetflow|iso|bgp\\.l(2|3)vpn)\\.\\d{1,2}(?:\\b)" 105 | }, 106 | { 107 | "comment": "Stanza double-line capture for user defined arbitrary names (such as filters, policy names, prefix-lists, etc)", 108 | "begin": "(?<=^|\\s)(logical-systems|\\sdynamic-profiles|\\sjsrc-partition|\\spartition|\\sfilter input|\\sfilter output|\\saccess-profile|\\sdscp|\\sdscp-ipv6|\\sexp|\\sieee-802\\.1|\\sieee-802\\.1ad|\\sinet-precedence|\\sscheduler-map|\\sscheduler-maps|\\sinput-traffic-control-profile-remaining|\\sinput-traffic-control-profile|\\straffic-control-profiles|\\soutput-traffic-control-profile-remaining|\\soutput-traffic-control-profile|\\soutput-forwarding-class-map|\\sscheduler-map-chassis|\\sfragmentation-maps|\\ssource-prefix-list|\\sbridge-domains|\\sgroup|\\smime-pattern|\\surl-pattern|\\slabel-switched-path|\\sadmin-groups|\\scustom-url-category|\\sprofile|\\surl-whitelist|\\surl-blacklist|\\sca-profile|\\sidp-policy|\\sactive-policy|\\sinterface-set|\\sinterface-range|\\scount|\\sdestination-prefix-list|\\sschedulers|\\sdrop-profiles|\\sforwarding-class|\\sforwarding-class-map|\\simport|\\sexport|\\sinstance|\\sutm-policy|\\sids-option|\\snext-hop-group|\\srouting-instances|\\srule|\\srule-set|\\spool|\\sclass|\\sunit|\\sport-mirror-instance|\\sfrom-zone|\\sto-zone|\\sapply-groups|\\sfile|\\shost-name|\\sdomain-name|\\spath|\\sdomain-search|\\scommunity delete|\\scommunity add|\\scommunity set|\\scommunity|\\strap-group|\\spolicy|\\spolicy-statement|\\simport-policy|\\sinstance-export|\\sinstance-import|\\svrf-import|\\svrf-export|\\simport|\\sexport|\\skeep-import|\\sinter-area-prefix-import|\\sinter-area-prefix-export|\\snetwork-summary-export|\\snetwork-summary-import|\\segress-policy|\\sbootstrap-import|\\sbootstrap-export|\\sfilter|\\sprefix-list|\\sproposal|\\saddress-set|\\sscheduler|\\srib-groups|\\sgroups|\\ssecurity-zone|\\sterm|\\sapplication|\\sapplication-set|\\svlans|\\sgateway|\\suser|\\spolicer|\\slsp|\\scondition)(?:\\s{\\s*)", 109 | "beginCaptures": { 110 | "1": { "name": "entity.name.function.junos" } 111 | }, 112 | "end": "\\s{|;", 113 | "patterns": [ 114 | { "name": "variable.language.junos", 115 | "match": "[-\\w_<>:\\./]+" 116 | } 117 | ] 118 | }, 119 | { 120 | "comment": "User defined arbitrary names (such as filters, policy names, prefix-lists, etc)", 121 | "match": "(?<=\\slogical-systems|\\sdynamic-profiles|\\sjsrc-partition|\\spartition|\\sfilter input|\\sfilter output|\\saccess-profile|\\sdscp|\\sdscp-ipv6|\\sexp|\\sieee-802\\.1|\\sieee-802\\.1ad|\\sinet-precedence|\\sscheduler-map|\\sscheduler-maps|\\sinput-traffic-control-profile-remaining|\\sinput-traffic-control-profile|\\straffic-control-profiles|\\soutput-traffic-control-profile-remaining|\\soutput-traffic-control-profile|\\soutput-forwarding-class-map|\\sscheduler-map-chassis|\\sfragmentation-maps|\\ssource-prefix-list|\\sbridge-domains|\\sgroup|\\smime-pattern|\\surl-pattern|\\slabel-switched-path|\\sadmin-groups|\\scustom-url-category|\\sprofile|\\surl-whitelist|\\surl-blacklist|\\sca-profile|\\sidp-policy|\\sactive-policy|\\sinterface-set|\\sinterface-range|\\scount|\\sdestination-prefix-list|\\sschedulers|\\sdrop-profiles|\\sforwarding-class|\\sforwarding-class-map|\\simport|\\sexport|\\sinstance|\\sutm-policy|\\sids-option|\\snext-hop-group|\\srouting-instances|\\srule|\\srule-set|\\spool|\\sclass|\\sunit|\\sport-mirror-instance|\\sfrom-zone|\\sto-zone|\\sapply-groups|\\sfile|\\shost-name|\\sdomain-name|\\spath|\\sdomain-search|\\scommunity delete|\\scommunity add|\\scommunity set|\\scommunity|\\strap-group|\\spolicy|\\spolicy-statement|\\simport-policy|\\sinstance-export|\\sinstance-import|\\svrf-import|\\svrf-export|\\simport|\\sexport|\\skeep-import|\\sinter-area-prefix-import|\\sinter-area-prefix-export|\\snetwork-summary-export|\\snetwork-summary-import|\\segress-policy|\\sbootstrap-import|\\sbootstrap-export|\\sfilter|\\sprefix-list|\\sproposal|\\saddress-set|\\sscheduler|\\srib-groups|\\sgroups|\\ssecurity-zone|\\sterm|\\sapplication|\\sapplication-set|\\svlans|\\sgateway|\\suser|\\spolicer|\\slsp|\\scondition)( [-\\w_<>:\\./]+)(?=[;]|\\b)", 122 | "captures": { 123 | "1": { "name": "variable.language.junos" } 124 | } 125 | }, 126 | { 127 | "comment": "IPv6 Addresses. This will not fully validate the structure of the IP, so some invalid IPv6 addresses might be false positives. IPv6 addresses themselves should be validated by running commands against a Junos device.", 128 | "name": "constant.numeric.integer.long.octal.junos", 129 | "match": "(?:\\s|^)((?=.*::)(?!.*::.+::)(::)?([\\dA-Fa-f]{1,4}:(:|\\b)|){5}|([\\dA-Fa-f]{1,4}:){6})((([\\dA-Fa-f]{1,4}(::|:\\b|[/]\\d+|))|(?!\\3\\4)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?){4})([/]\\d{1,3})?(?:\\s|;)" 130 | }, 131 | { 132 | "comment": "Other general numbers", 133 | "match": "(?':\\.\/\\[\\]]+)\\b", 175 | "captures": { 176 | "1": { "name": "string.quoted.double.junos" } 177 | } 178 | } 179 | ], 180 | "uuid": "a24afbf3-0a1e-4795-87c3-7bb7e582bffe" 181 | } 182 | -------------------------------------------------------------------------------- /Junos.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | conf 8 | conf.1 9 | conf.2 10 | conf.3 11 | conf.4 12 | conf.5 13 | conf.6 14 | conf.7 15 | conf.8 16 | conf.9 17 | conf.10 18 | conf.11 19 | conf.12 20 | conf.13 21 | conf.14 22 | conf.15 23 | conf.16 24 | conf.17 25 | conf.18 26 | conf.19 27 | conf.20 28 | conf.21 29 | conf.22 30 | conf.23 31 | conf.24 32 | conf.25 33 | conf.26 34 | conf.27 35 | conf.28 36 | conf.29 37 | conf.30 38 | conf.31 39 | conf.32 40 | conf.33 41 | conf.34 42 | conf.35 43 | conf.36 44 | conf.37 45 | conf.38 46 | conf.39 47 | conf.40 48 | conf.41 49 | conf.42 50 | conf.43 51 | conf.44 52 | conf.45 53 | conf.46 54 | conf.47 55 | conf.48 56 | conf.49 57 | 58 | name 59 | Junos 60 | patterns 61 | 62 | 63 | begin 64 | /\* 65 | captures 66 | 67 | 0 68 | 69 | name 70 | comment.block.junos 71 | 72 | 73 | comment 74 | Block Comment or annotation 75 | end 76 | (\*/| 77 | ) 78 | name 79 | comment.block.junos 80 | 81 | 82 | captures 83 | 84 | 2 85 | 86 | name 87 | punctuation.definition.comment.junos 88 | 89 | 90 | comment 91 | Line comment, anything following a hashtag (#) 92 | match 93 | (^|^\s|\s)(#).*$ 94 | ? 95 | name 96 | comment.line.number-sign.junos 97 | 98 | 99 | begin 100 | (?<=^|\s)(apply-groups|groups|access-profile|vlans|bridge-domains|routing-instances|dynamic-profiles|jsrc-partition|logical-systems)(?:\s{\s*) 101 | beginCaptures 102 | 103 | 1 104 | 105 | name 106 | entity.name.function.junos 107 | 108 | 109 | comment 110 | sections that have a user-defined sub-item, but modified to capture in stanza mode. Had to be its own capture, since it covers multiple lines. 111 | end 112 | \s{|; 113 | patterns 114 | 115 | 116 | match 117 | [-\w_<>:\./]+ 118 | name 119 | variable.language.junos 120 | 121 | 122 | 123 | 124 | captures 125 | 126 | 1 127 | 128 | name 129 | entity.name.function.junos 130 | 131 | 132 | comment 133 | Major sections of the configuration 134 | match 135 | (?<=^|\s)(system|forwarding-options|routing-options|routing-instances|logical-systems|vlans|bridge-domains|dynamic-profiles|interfaces|snmp|poe|ethernet-switching-options|security)(?=[ 136 | ;]) 137 | 138 | 139 | captures 140 | 141 | 1 142 | 143 | name 144 | entity.name.function.junos 145 | 146 | 147 | comment 148 | minor sections of the config. 149 | match 150 | (?<=^|\s)(policy-options|protocols|chassis|firewall|applications|multi-chassis|redundant-power-system|version|services|virtual-chassis|event-options|class-of-service|access|accounting-options|diameter|fabric|multicast-snooping-options|switch-options|wlan|smtp|schedulers)(?=[ 151 | ;]) 152 | 153 | 154 | comment 155 | keywords captured without a major/minor section attached 156 | match 157 | (?<=^|\s)(set|request|delete|edit|show|protect:?|inactive:|unprotect|deactivate|activate)(?= ) 158 | name 159 | keyword.control.junos 160 | 161 | 162 | comment 163 | Policy/filter denial/rejection actions 164 | match 165 | (?<=\s)(deny|discard|reject)(?=\s|;|$) 166 | name 167 | invalid.illegal.junos 168 | 169 | 170 | comment 171 | Policy/filter accept/permit actions 172 | match 173 | (?<=\s)(accept|permit)(?=\s|;|$) 174 | name 175 | constant.language.junos 176 | 177 | 178 | comment 179 | Interface names 180 | match 181 | \b((((ge|et|so|fe|gr|xe|lt|vt|si|sp)(-\d+/\d+/\d+))|(st|lo|me|vme|ae)\d{1,3}|irb|vlan)(\.\d{1,5})?)\b(?![-_<>]) 182 | name 183 | support.class.junos 184 | 185 | 186 | comment 187 | IPv4 addresses, with or without a mask 188 | match 189 | \b((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))([/]\d{1,2})?\b 190 | name 191 | constant.numeric.integer.long.octal.junos 192 | 193 | 194 | comment 195 | MAC Addresses identified as a number 196 | match 197 | (?:(\b))([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})([/]\d{1,2})?\b 198 | name 199 | constant.numeric.integer.long.octal.junos 200 | 201 | 202 | captures 203 | 204 | 1 205 | 206 | name 207 | constant.numeric.integer.long.octal.junos 208 | 209 | 210 | comment 211 | Unit numbers, port numbers, etc 212 | match 213 | (?:\s(?:(?:peer-)?unit|queue(?:-num)?|destination-port|source-port)[ ])((\d{1,5})(-\d{1,5})?)(?=[;]|$|\b) 214 | 215 | 216 | comment 217 | URL Addresses, either matching character URL patterns, or http(s):// followed by an IPv4 address. 218 | match 219 | \b((https?:)|(scp:)|((s?|t?)ftp:))//((([\da-zA-Z\.-]+)\.([A-Za-z\.]{2,6}))|(\b((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\b))(([/\w\.&?=+-]*)*)/? 220 | name 221 | keyword.operator.junos 222 | 223 | 224 | comment 225 | Routing table names 226 | match 227 | (?<=\s)([\w\d_-]+\.)?(inet6?|mpls|inetflow|iso|bgp\.l(2|3)vpn)\.\d{1,2}(?:\b) 228 | name 229 | keyword.operator.junos 230 | 231 | 232 | begin 233 | (?<=^|\s)(logical-systems|\sdynamic-profiles|\sjsrc-partition|\spartition|\sfilter input|\sfilter output|\saccess-profile|\sdscp|\sdscp-ipv6|\sexp|\sieee-802\.1|\sieee-802\.1ad|\sinet-precedence|\sscheduler-map|\sscheduler-maps|\sinput-traffic-control-profile-remaining|\sinput-traffic-control-profile|\straffic-control-profiles|\soutput-traffic-control-profile-remaining|\soutput-traffic-control-profile|\soutput-forwarding-class-map|\sscheduler-map-chassis|\sfragmentation-maps|\ssource-prefix-list|\sbridge-domains|\sgroup|\smime-pattern|\surl-pattern|\slabel-switched-path|\sadmin-groups|\scustom-url-category|\sprofile|\surl-whitelist|\surl-blacklist|\sca-profile|\sidp-policy|\sactive-policy|\sinterface-set|\sinterface-range|\scount|\sdestination-prefix-list|\sschedulers|\sdrop-profiles|\sforwarding-class|\sforwarding-class-map|\simport|\sexport|\sinstance|\sutm-policy|\sids-option|\snext-hop-group|\srouting-instances|\srule|\srule-set|\spool|\sclass|\sunit|\sport-mirror-instance|\sfrom-zone|\sto-zone|\sapply-groups|\sfile|\shost-name|\sdomain-name|\spath|\sdomain-search|\scommunity delete|\scommunity add|\scommunity set|\scommunity|\strap-group|\spolicy|\spolicy-statement|\simport-policy|\sinstance-export|\sinstance-import|\svrf-import|\svrf-export|\simport|\sexport|\skeep-import|\sinter-area-prefix-import|\sinter-area-prefix-export|\snetwork-summary-export|\snetwork-summary-import|\segress-policy|\sbootstrap-import|\sbootstrap-export|\sfilter|\sprefix-list|\sproposal|\saddress-set|\sscheduler|\srib-groups|\sgroups|\ssecurity-zone|\sterm|\sapplication|\sapplication-set|\svlans|\sgateway|\suser|\spolicer|\slsp|\scondition)(?:\s{\s*) 234 | beginCaptures 235 | 236 | 1 237 | 238 | name 239 | entity.name.function.junos 240 | 241 | 242 | comment 243 | Stanza double-line capture for user defined arbitrary names (such as filters, policy names, prefix-lists, etc) 244 | end 245 | \s{|; 246 | patterns 247 | 248 | 249 | match 250 | [-\w_<>:\./]+ 251 | name 252 | variable.language.junos 253 | 254 | 255 | 256 | 257 | captures 258 | 259 | 1 260 | 261 | name 262 | variable.language.junos 263 | 264 | 265 | comment 266 | User defined arbitrary names (such as filters, policy names, prefix-lists, etc) 267 | match 268 | (?<=\slogical-systems|\sdynamic-profiles|\sjsrc-partition|\spartition|\sfilter input|\sfilter output|\saccess-profile|\sdscp|\sdscp-ipv6|\sexp|\sieee-802\.1|\sieee-802\.1ad|\sinet-precedence|\sscheduler-map|\sscheduler-maps|\sinput-traffic-control-profile-remaining|\sinput-traffic-control-profile|\straffic-control-profiles|\soutput-traffic-control-profile-remaining|\soutput-traffic-control-profile|\soutput-forwarding-class-map|\sscheduler-map-chassis|\sfragmentation-maps|\ssource-prefix-list|\sbridge-domains|\sgroup|\smime-pattern|\surl-pattern|\slabel-switched-path|\sadmin-groups|\scustom-url-category|\sprofile|\surl-whitelist|\surl-blacklist|\sca-profile|\sidp-policy|\sactive-policy|\sinterface-set|\sinterface-range|\scount|\sdestination-prefix-list|\sschedulers|\sdrop-profiles|\sforwarding-class|\sforwarding-class-map|\simport|\sexport|\sinstance|\sutm-policy|\sids-option|\snext-hop-group|\srouting-instances|\srule|\srule-set|\spool|\sclass|\sunit|\sport-mirror-instance|\sfrom-zone|\sto-zone|\sapply-groups|\sfile|\shost-name|\sdomain-name|\spath|\sdomain-search|\scommunity delete|\scommunity add|\scommunity set|\scommunity|\strap-group|\spolicy|\spolicy-statement|\simport-policy|\sinstance-export|\sinstance-import|\svrf-import|\svrf-export|\simport|\sexport|\skeep-import|\sinter-area-prefix-import|\sinter-area-prefix-export|\snetwork-summary-export|\snetwork-summary-import|\segress-policy|\sbootstrap-import|\sbootstrap-export|\sfilter|\sprefix-list|\sproposal|\saddress-set|\sscheduler|\srib-groups|\sgroups|\ssecurity-zone|\sterm|\sapplication|\sapplication-set|\svlans|\sgateway|\suser|\spolicer|\slsp|\scondition)( [-\w_<>:\./]+)(?=[;]|\b) 269 | 270 | 271 | comment 272 | IPv6 Addresses. This will not fully validate the structure of the IP, so some invalid IPv6 addresses might be false positives. IPv6 addresses themselves should be validated by running commands against a Junos device. 273 | match 274 | (?:\s|^)((?=.*::)(?!.*::.+::)(::)?([\dA-Fa-f]{1,4}:(:|\b)|){5}|([\dA-Fa-f]{1,4}:){6})((([\dA-Fa-f]{1,4}(::|:\b|[/]\d+|))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?){4})([/]\d{1,3})?(?:\s|;) 275 | name 276 | constant.numeric.integer.long.octal.junos 277 | 278 | 279 | captures 280 | 281 | 1 282 | 283 | name 284 | constant.numeric.integer.long.octal.junos 285 | 286 | 287 | comment 288 | Other general numbers 289 | match 290 | (?<!term )(?<=\s)(\d+)(?=[;]|\s) 291 | 292 | 293 | begin 294 | " 295 | beginCaptures 296 | 297 | 0 298 | 299 | name 300 | punctuation.definition.string.begin.junos 301 | 302 | 303 | comment 304 | Double quoted strings 305 | end 306 | " 307 | endCaptures 308 | 309 | 0 310 | 311 | name 312 | punctuation.definition.string.end.junos 313 | 314 | 315 | name 316 | string.quoted.double.junos 317 | patterns 318 | 319 | 320 | match 321 | \\. 322 | name 323 | constant.character.escape.junos 324 | 325 | 326 | 327 | 328 | begin 329 | ' 330 | beginCaptures 331 | 332 | 0 333 | 334 | name 335 | punctuation.definition.string.begin.junos 336 | 337 | 338 | comment 339 | Single quoted strings 340 | end 341 | ' 342 | endCaptures 343 | 344 | 0 345 | 346 | name 347 | punctuation.definition.string.end.junos 348 | 349 | 350 | name 351 | string.quoted.single.junos 352 | patterns 353 | 354 | 355 | match 356 | \\. 357 | name 358 | constant.character.escape.junos 359 | 360 | 361 | 362 | 363 | captures 364 | 365 | 1 366 | 367 | name 368 | string.quoted.double.junos 369 | 370 | 371 | comment 372 | Descriptions should always look like strings, even if no quotations are needed 373 | match 374 | (?:\sdescription )([-_\w<>':\./\[\]]+)\b 375 | 376 | 377 | scopeName 378 | text.junos 379 | uuid 380 | a24afbf3-0a1e-4795-87c3-7bb7e582bffe 381 | 382 | 383 | --------------------------------------------------------------------------------