Quote:
Originally Posted by maciekmacku
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