VanDyke Software Forums

VanDyke Software Forums (
-   Secure Shell (
-   -   Highlight Keyword with Regex Positive Look Ahead (

WesR 05-19-2021 09:54 AM

Highlight Keyword with Regex Positive Look Ahead
I'm trying to highlight the sequence "site=name&" without including the "&" in the highlight.

In regex, I can use the following query and it works, but in SecureCRT highlighting it does not.
Does SecureCRT support this?

If I use "site=.*?\&", the whole sequence is highlighted including the "&".

I'm using SecureCRT Version 8.2.0 (x64 build 1402)

bgagnon 05-19-2021 11:25 AM

Hi WesR,

I think you have one too many closing parens.

This works for me in v9.0.1:

This does not:

If you think the double close parens is correct, please post the text you are testing against.

As a note, v8.2 was not even an official release but it's very old. You might check your upgrade eligibility.

WesR 05-19-2021 11:52 AM

Thanks and sorry, not sure how that extra Paren made it in there, but it is in the post only.

It still does not work for me in 8.2.

WesR 05-19-2021 12:59 PM

Here is an example of the type of string I'm testing against:


In this case,


doesn't highlight anything.

I can see what I can do with upgrading, but because this was a corporate purchase done for me, I don't know what it might take.


bgagnon 05-19-2021 01:13 PM

Hi Wes,

Keyword highlighting/regex has been enhanced since v8.2. The first version in which this will work is v8.7.

Changes in SecureCRT 8.7 (Beta 1) -- November 20, 2019
New features:

  • Keyword highlighting supports the ability to match phrases and substrings and works with literal strings and regular expressions.

What did you find when you checked upgrade eligibility? What is the most recent version your license provides access to? (Please do not post the serial number here, if unsure, please send email to and we can check for you.)

WesR 05-19-2021 01:18 PM

I was able to upgrade to 8.3.4 (x64 build 1699), but unfortunately get the same results.


WesR 05-19-2021 01:20 PM

Just saw your post. I don't think I can get to 8.7 or higher easily.


WesR 06-03-2021 03:01 PM

1 Attachment(s)
hmmm well I was able to purchase a license for 9.0.2 :), but I get the same results.


does not work.

Using the following does, but includes the &.


As can be seen in the attachment.
The string I am testing against is:

bgagnon 06-03-2021 03:28 PM

1 Attachment(s)
Hi Wes,

And, as before, it does highlight the correct characters for me. :)
That is the text you expect to be highlighted, correct?

Are you sure the version is 9.0?

Please embed a graphic showing the same category in your Session Options configuration.

If that might expose sensitive info, send an email to and reference Attn Brenda - Forum Thread #14533 in the subject line (and attach the screenshot).

bgagnon 06-03-2021 03:33 PM

Hi WesR,

By the way, a colleague just informed me a look-ahead is not even necessary for what you are trying to accomplish.

If you use this pattern, you should also get the desired results:



WesR 06-03-2021 05:04 PM

3 Attachment(s)
Ha! Thanks. That workaround without lookaround does work!

I am still curious why the other query is not working. Attached are a some screenshots. I didn't escape the & in the first one. It seems to work either way including with your workaround.

I was just about to click send when I thought... Hey, my List has a lot of things being highlighted. I created a new list with just the

Regex in it and it works!

I also checked in my old 8.3 version and the workaround works with that version as well.

WesR 06-03-2021 05:57 PM

Ok, so I copied my LogErrors.ini file to a new file and restarted.

I then started deleting things. First all the Regex entries and then the other entries. I am left with only the one Regex entry and it still doesn't work. I now have a test file with one entry that works and the LogErrorsCopy with one entry that doesn't. Both only 'show' the one entry.


D:"Match Case"=00000000
D:"Regex Line Mode"=00000001
Z:"Keyword List V2"=00000001

S:"Keyword List"=denied eofexception err error Exception fail failure forbidden warn
D:"Match Case"=00000000
D:"Regex Line Mode"=00000000
Z:"Keyword List V2"=00000001
What is this Keyword list and why doesn't it appear in the GUI?

Removing the Keyword List line and reloading SecureCRT showed no change.
Changing the Regex Line Mode to 1 did allow it to work.

This seems to equate to the Advanced/Match style setting which is new. Setting this to Phrases and substrings allowed this to work with all the highlighting rules I have tried. Yeah!


bgagnon 06-04-2021 07:17 AM

Hi WesR,

Hey, my List has a lot of things being highlighted. I created a new list with just the ...
So it was likely a case of "precedence" (order). There was a match based on a regex higher in the list before it reached the one you really wanted it to match on. :)

I am glad you have resolved the issue.

WesR 06-04-2021 07:47 AM

This was not a case of Precedence or Order.

I attempted to convey that I changed it until there was a single entry and it still failed.

It was due to the new (to me and my old version) Keyword Highlighting/Advanced setting set to Whole words. Once I set this to Phrases and Substrings, it worked with my whole list as well as the single list.

Do you know what the

S:"Keyword List"=denied eofexception err error Exception fail failure forbidden warn
is and why it is not displayed in the GUI?

Is this just an old item that is no longer supported or something?

bgagnon 06-04-2021 08:04 AM

Hi WesR,

My apologies if I missed something. You have posted a lot of info in a short period of time. :)

I do not know why that string is in the Keyword List name field. Manually editing keyword list INI files is very much discouraged as the format may change from version to version. Are you sure the correct format was retained in the file after your edits?

All times are GMT -6. The time now is 01:37 PM.