#1
|
|||
|
|||
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. site=.*?(?=\&))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) |
#2
|
|||
|
|||
Hi WesR,
I think you have one too many closing parens. This works for me in v9.0.1: site=.*?(?=\&) This does not: site=.*?(?=\&)) 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.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
Here is an example of the type of string I'm testing against:
enterprise=enterprise1&site=TestSite1&area=Area1&line=Line1& In this case, Quote:
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. Wes |
#5
|
|||
|
|||
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:
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 support@vandyke.com and we can check for you.)
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by bgagnon; 05-19-2021 at 01:17 PM. |
#6
|
|||
|
|||
I was able to upgrade to 8.3.4 (x64 build 1699), but unfortunately get the same results.
Wes |
#7
|
|||
|
|||
Just saw your post. I don't think I can get to 8.7 or higher easily.
Thanks |
#8
|
|||
|
|||
hmmm well I was able to purchase a license for 9.0.2
![]() Quote:
Using the following does, but includes the &. Quote:
The string I am testing against is: enterprise=enterprise1&site=TestSite1&area=Area1&line=Line1&Thanks Last edited by jdev; 06-03-2021 at 03:15 PM. Reason: Embed graphic for easier viewing. |
#9
|
|||
|
|||
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 support@vandyke.com and reference Attn Brenda - Forum Thread #14533 in the subject line (and attach the screenshot).
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#10
|
|||
|
|||
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: Code:
site=[^\&]+
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#11
|
|||
|
|||
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 Quote:
I also checked in my old 8.3 version and the workaround works with that version as well. |
#12
|
|||
|
|||
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. Test: Quote:
Quote:
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! Wes |
#13
|
|||
|
|||
Hi WesR,
Quote:
![]() I am glad you have resolved the issue.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#14
|
|||
|
|||
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 Quote:
Is this just an old item that is no longer supported or something? |
#15
|
|||
|
|||
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?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by bgagnon; 06-04-2021 at 08:37 AM. Reason: Clarification |
![]() |
Thread Tools | |
Display Modes | |
|
|