View Single Post
  #2  
Old 12-04-2020, 11:12 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,096
Quote:
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.

example:

"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+
Notes:
  • 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
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support