Forum / Remote Desktop Manager - Feature Request

SSH syntax highlighting: support regular expressions

  • Create an Issue
  • Cancel

That would be great if we could input some regex for the keyword of syntax highlighting entries:

image

Clock8 mths

Hello,
I'm not sure if I it's possible but I will add this to our todo.

Regards

David Hervieux

signaturesignature

Clock8 mths

Thanks! smile

Clock8 mths

Are there any available files for import? For instance a file for Cisco CLI devices. One that has already defined the keywords.

Clock4 mths

Not to my knowledge, but if you create one, I'd be keen to test it!

Clock4 mths

Syntax highlighting would be an awesome feature. We currently have a Cisco keyword file that was built around SecureCRT and uses regular expressions.


It would be nice to have similar functionality with regular expressions to easily match dynamic output, such as IP Addresses, MAC addresses and interfaces.

Clock4 mths

Alex Deems wrote:

It would be nice to have similar functionality with regular expressions to easily match dynamic output, such as IP Addresses, MAC addresses and interfaces.

Thanks for chiming in, that's exactly why I requested this feature.

Clock4 mths

Just FYI, I wouldn't be very hopeful for this feature.
I asked this same thing of SecureCRT before we purchased RDM.

Their rationale is that in order to support regular expressions in the outputs, the program (RDM) must first parse the entire output so it can run the expressions against, then present it to the user. This is incredibly resource intensive to try and do real-time.
It would almost certainly slow down command outputs to the point you would notice and think the interface is 'slow' or 'unresponsive'.

Clock4 mths

H K wrote:

Just FYI, I wouldn't be very hopeful for this feature.
I asked this same thing of SecureCRT before we purchased RDM.

Their rationale is that in order to support regular expressions in the outputs, the program (RDM) must first parse the entire output so it can run the expressions against, then present it to the user. This is incredibly resource intensive to try and do real-time.

It would almost certainly slow down command outputs to the point you would notice and think the interface is 'slow' or 'unresponsive'.

I am not sure when you switched to RDM, but I have seen secureCRT support syntax highlighting for years. In fact it was originally released back in 2009 on SecureCRT 6.5.

Clock4 mths

I'm not talking about syntax highlighting the word 'down' as the color red.
I'm talking about regular expressions to distinguish 'down' from 'administratively down' as a phrase.
Or a regular expression to identify a MAC address as xxxx.xxxx.xxxx or xx:xx:xx:xx:xx:xx and highlight it accordingly.

Syntax highlighting, and supporting regular expressions are 2 different things.

Clock4 mths

Yes, SecureCRT has support regular expressions to match syntax highlighting for years. Specifically to your example, I have in a keyword file the following two strings to match mac addresses.


"(?:[a-f0-9]{2}[:-]){5}[a-f0-9]{2}",00408000,00000001
"[a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}",00408000,00000001

I have attached my old keyword file with all of the various regular expressions to do the syntax highlighting. I think you can load the keyword file in a demo of SecureCRT for testing.

Cisco Words.ini
Clock4 mths

interesting. good to know.
Have you noticed the command outputs to be slower then without regex syntax highlighting?
When you do a show run, are the pauses between pressing space bar noticeable while securecrt chew through the outputs?

Clock4 mths

H K wrote:

It would almost certainly slow down command outputs to the point you would notice and think the interface is 'slow' or 'unresponsive'.

Recent text editors / IDE are already doing this at a much larger scale (opening files of thousands/millions of lines with syntax highlighting). Parsing one line and checking against a regex to apply some syntax highlighting isn't going to kill the performances if the code is done right. Plus, I doubt your terminal is outputting thousands of lines per second.

Clock4 mths

H K wrote:

interesting. good to know.
Have you noticed the command outputs to be slower then without regex syntax highlighting?
When you do a show run, are the pauses between pressing space bar noticeable while securecrt chew through the outputs?


There is no noticeable impact to the output of show run, even if you set the terminal length to 0, it outputs just as fast with regex syntax highlighting. If there were thousands of lines per second being outputted then I could see the reasoning behind not performing syntax highlighting because of a performance impact.

Clock4 mths

Alex Deems wrote:

Yes, SecureCRT has support regular expressions to match syntax highlighting for years. Specifically to your example, I have in a keyword file the following two strings to match mac addresses.


"(?:[a-f0-9]{2}[:-]){5}[a-f0-9]{2}",00408000,00000001
"[a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}",00408000,00000001

I have attached my old keyword file with all of the various regular expressions to do the syntax highlighting. I think you can load the keyword file in a demo of SecureCRT for testing.


So I remember now what Van Dyke said was the performance hit.
Regular expressions with spaces. SecureCRT does not support regex with spaces. So you can't do 'admin down' as a single entry.

Clock4 mths

David Hervieux wrote:

Hello,
I'm not sure if I it's possible but I will add this to our todo.

Regards


any updates?

Clock3 mths

Nothing new for now. It's not even planned for RDM 14.

Regards

David Hervieux

signaturesignature

Clock3 mths

Is there anyway to highlight IP addresses through the Syntax Highlighting? I agree it would be great to have Syntax Highlighting support expressions.

Clock3 mths

Ashley Neumeister wrote:

Is there anyway to highlight IP addresses through the Syntax Highlighting?

Unfortunately no.

Clock3 mths