Skip to content

Commit

Permalink
Explicitly specifiy min 0 in quantifier
Browse files Browse the repository at this point in the history
This improves support for other RegEx engines (e.g. PCRE)
  • Loading branch information
hSaria committed Feb 5, 2022
1 parent 9f15871 commit aa4db78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chromaterm/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
r'''(?ix)\b
((htt|ft|lda)ps?|telnet|ssh):// # Scheme
([-%:\w\\/]{1,256}@)? # User info
[-\w]{1,63}(\.[-\w]{1,63}){,126}(:\d{1,5})? # Host and port
[-\w]{1,63}(\.[-\w]{1,63}){0,126}(:\d{1,5})? # Host and port
(/[-+=~@%&?#.:;,\w\\/()]*)? # Path, query, and fragment
((?=[.:;,)])|\b) # Avoid highlighting trailing path characters by matching them in a lookahead
''',
Expand Down
6 changes: 3 additions & 3 deletions contrib/rules/cisco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Translated to YAML in https://github.com/hSaria/ChromaTerm/pull/79

- description: IP-address:nn RD or RT
regex: \b(RT:)?((25[0-5]|(2[0-4]|[0-1]?\d)?\d)\.){3}(25[0-5]|(2[0-4]|[0-1]?\d)?\d):[1-9]\d{,4}\b
regex: \b(RT:)?((25[0-5]|(2[0-4]|[0-1]?\d)?\d)\.){3}(25[0-5]|(2[0-4]|[0-1]?\d)?\d):[1-9]\d{0,4}\b
color: f#00e0d1
exclusive: true

Expand All @@ -21,12 +21,12 @@
color: b#a35a00

- description: Interfaces
regex: (?i)\b(((Hu(ndredGigabit)?|Fo(rtyGigabit)?|Te(nGigabit)?|Gi(gabit)?|Fa(st)?)(Ethernet)?)|Eth|Se(rial)?|Lo(opback)?|Tu(nnel)?|VL(AN)?|Po(rt-channel)?|Vi(rtual\-(Template|Access))?|Mu(ltilink)?|Di(aler)?|[BN]VI)(\d+/){,2}\d+(\.\d+)?\b
regex: (?i)\b(((Hu(ndredGigabit)?|Fo(rtyGigabit)?|Te(nGigabit)?|Gi(gabit)?|Fa(st)?)(Ethernet)?)|Eth|Se(rial)?|Lo(opback)?|Tu(nnel)?|VL(AN)?|Po(rt-channel)?|Vi(rtual\-(Template|Access))?|Mu(ltilink)?|Di(aler)?|[BN]VI)(\d+/){0,2}\d+(\.\d+)?\b
color: f#03d28d
exclusive: true

- description: Bad responses
regex: \b(administratively|down|Down|DOWN|fail|failed|not|not active|not activated|bad|never|BLK|fddi|n\-isl|isl|notconnect|blocking|\(tdp\)|tdp|TDP|denied|invalid|err\-disabled|disabled|unusable|DENIED|err\-disable|infinity|inaccessible|wrong|cannot|MM_NO_STATE|MM_KEY_EXCH|UP\-NO\-IKE|K[13]=(\d{2,3}|[02-9])|K[245]=[1-9]\d{,2})\b
regex: \b(administratively|down|Down|DOWN|fail|failed|not|not active|not activated|bad|never|BLK|fddi|n\-isl|isl|notconnect|blocking|\(tdp\)|tdp|TDP|denied|invalid|err\-disabled|disabled|unusable|DENIED|err\-disable|infinity|inaccessible|wrong|cannot|MM_NO_STATE|MM_KEY_EXCH|UP\-NO\-IKE|K[13]=(\d{2,3}|[02-9])|K[245]=[1-9]\d{0,2})\b
color: f#c71800

- description: Good responses
Expand Down

0 comments on commit aa4db78

Please sign in to comment.