View Single Post
Old 12-04-2020, 12:12 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Originally Posted by maciekmacku View Post
Is there any option to highlight a word that appears after the specified word? I'm mostly working with Juniper and I would like to highlight zone names that appears after combination "from-zone" and "to-zone" without adding each zone one by one to the Keyword list.


"set security policies from-zone EXAMPLE_1234 to-zone EXAMPLE_4321 policy TEST"
Yes, with regular expression keyword highlighting with sub-string (spaces in regular expressions) support in SecureCRT version 8.7 or newer, you could use pattern that implement a look-behind strategy. As examples (two separate patterns):
(?<=from-zone )\S+
(?<=to-zone )\S+
  • In order to use such patterns (patterns which include spaces), you must first ensure that you open Session Options, navigate to the Terminal / Keyword Highlighting / Advanced category and set the the Match style to be: Phrases and substrings
  • Whatever is between the (?<=[/B] and the closing ) will be looked for as a condition for matching, but not included in the actual match.
  • There is a trailing space character following the word "zone" in each pattern above.
  • The \S+ portion of the expression represents "One or more non-whitespace characters"; in other words, it represents the text you want to be highlighted.
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: