# Coloring of syntax in SSH sessions

**URL:** https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474
**Category:** Royal TS (for Windows)
**Created:** [August 9, 2017, 6:14am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474 "2017-08-09T06:14:51Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![stefan\_koell](https://community.royalapps.com/user_avatar/community.royalapps.com/stefan_koell/32/9_2.png) [@stefan\_koell](https://community.royalapps.com/u/stefan_koell)
#### Post date: [September 17, 2018, 6:04pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/21 "2018-09-17T18:04:38Z")

</div>

Hi Adam,

you first need to go to the “Plugin” page in the properties and change the active plugin to “Rebex”. After that you need to re-open the bulk-edit dialog. Let me know if this helps.

Regards,  
Stefan

---

<div class="post-metadata">

### Author: ![goncalo\_pinto](https://community.royalapps.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@goncalo\_pinto](https://community.royalapps.com/u/goncalo_pinto)
#### Post date: [October 22, 2018, 11:20am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/22 "2018-10-22T11:20:14Z")

</div>

how do I create Regular Expressions in order make case insensitive syntax coloring?

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 22, 2018, 4:11pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/23 "2018-10-22T16:11:39Z")

</div>

The ‘i’ flag in regex matches all cases.

For instance;

(?i)down

Matches DOWN, Down and down (or DoWn if your devices are weird…)

Here are the ones I have setup currently that work for me:

# Matches IP addresses

\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b

#55FFFF

#000000

# Matches any case of the word ‘down’

(?i)down

#FFFF55

#000000

# Matches any case of a word that starts with vlan. (vlan, VLANS, etc.)

(?i)vlan(\w+)|vlan

#5555FF

#000000

# Matches any case of a word that starts with fail. (fail, Failure, etc.)

(?i)fail(\w+)|fail

#FF5555

#000000

# Matches any case of a word that starts with warn. (warn, WARNING, etc.)

(?i)warn(\w+)|warn

#FFC000

#000000

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 22, 2018, 4:14pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/24 "2018-10-22T16:14:18Z")

</div>

I should clarify; when you pipe a word that’s an or.

So strictly speaking in the last three I put up there the pattern before the pipe matches anything with starting with the word that has something else after it, and after the pipe it matches the word itself.

I’m sure there’s a more elegant way to do it but I’m not an expert in regex…

---

<div class="post-metadata">

### Author: ![goncalo\_pinto](https://community.royalapps.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@goncalo\_pinto](https://community.royalapps.com/u/goncalo_pinto)
#### Post date: [October 23, 2018, 7:37am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/25 "2018-10-23T07:37:22Z")

</div>

Thank you, Adam.

I tried all of the syntaxes in:  
[https://stackoverflow.com/questions/9655164/regex-ignore-case-sensitivity](https://stackoverflow.com/questions/9655164/regex-ignore-case-sensitivity)  
I also tried to use [regexr.com](http://regexr.com) for creating the syntaxes but none of them worked.

---

<div class="post-metadata">

### Author: ![goncalo\_pinto](https://community.royalapps.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@goncalo\_pinto](https://community.royalapps.com/u/goncalo_pinto)
#### Post date: [October 23, 2018, 7:47am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/26 "2018-10-23T07:47:42Z")

</div>

Also, is there a better way of doing:  
(?i)err(\w+)|err|(?i)disable(\w+)|disable|(?i)fail(\w+)|fail

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 23, 2018, 4:14pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/27 "2018-10-23T16:14:48Z")

</div>

I _think_ you can take out all but the first (?i) if you use that as a single string.

Something like:

(?i)err(\w+)|err|disable(\w+)|disable|fail(\w+)|fail

Definitely not more elegant, but a bit shorter and should be functional? I would need to test it out.

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 23, 2018, 4:59pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/28 "2018-10-23T16:59:40Z")

</div>

Actually, I think this might be better:

(?i)disable(\w\*)|fail(\w\*)

This should cover all iterations with the words in them. I’m struggling with ‘err’ though.

(?im)^err(\w\*)

This should cover everything that begins with “err” case insensitive. However, it isn’t working in RTS for me.

You could use:

(?i)err(\w\*)

or have a single line:

(?i)disable(\w\*)|fail(\w\*)|err(\w\*)

But this will catch anything with err in the string.

It will catch “err”, “error” but will also catch “overruns” because it has “err” in it. So it will catch anything with “err” anywhere in the word.

Not sure how Royal implemented regex, but I haven’t been able to figure out how to do start string matches yet.

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 23, 2018, 5:38pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/29 "2018-10-23T17:38:17Z")

</div>

Alright, I got a new one…it’s more complected but also includes more options. I grabbed the major sytax from another vendor, but it seems to work with RTS:

(¨( \*)?no | down |[^A-Za-z0-9](disabl(\w\*)|fault|shutdown|disconnected|err(\w\*)|ERR(\w\*)|fail(\w\*)|denied|not permitted|disallowed|not allowed|refused|problem|not permitted|notconnect)[^A-Za-z0-9])

You can take out or add anything between the first set of parentheses after the “[^A-Za-z0-9]”.

The first “| down |” only matches the string “down” with a space before and after. You can exclude that entirely if you want.

---

<div class="post-metadata">

### Author: ![goncalo\_pinto](https://community.royalapps.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@goncalo\_pinto](https://community.royalapps.com/u/goncalo_pinto)
#### Post date: [October 24, 2018, 7:05am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/30 "2018-10-24T07:05:20Z")

</div>

that’s great Adam!

Thank you very much, it’s been a long time since I learned and used RegEx.

---

<div class="post-metadata">

### Author: ![goncalo\_pinto](https://community.royalapps.com/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@goncalo\_pinto](https://community.royalapps.com/u/goncalo_pinto)
#### Post date: [October 24, 2018, 7:52am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/31 "2018-10-24T07:52:28Z")

</div>

This isn’t working in my RTS:

```auto
(¨( *)?no | down |[^A-Za-z0-9](disabl(\w*)|fault|shutdown|disconnected|err(\w*)|ERR(\w*)|fail(\w*)|denied|not permitted|disallowed|not allowed|refused|problem|not permitted|notconnect)[^A-Za-z0-9])

```

I’m not using the latest version though, could that be an issue?

---

<div class="post-metadata">

### Author: ![metzler\_adam](https://community.royalapps.com/user_avatar/community.royalapps.com/metzler_adam/32/312_2.png) [@metzler\_adam](https://community.royalapps.com/u/metzler_adam)
#### Post date: [October 30, 2018, 5:26pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/32 "2018-10-30T17:26:48Z")

</div>

Could be? I’m using 5.0.11009 and it is working for me. Is there a specific word that isn’t working?

---

<div class="post-metadata">

### Author: ![stefan\_koell](https://community.royalapps.com/user_avatar/community.royalapps.com/stefan_koell/32/9_2.png) [@stefan\_koell](https://community.royalapps.com/u/stefan_koell)
#### Post date: [January 2, 2019, 12:54pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/33 "2019-01-02T12:54:49Z")

</div>

I’m happy to report that Royal TS 5.0 has been released and includes this feature.

For more information about the major new features of Royal TS 5.0, please head over to our [https://www.royalapplications.com/ts/win/features-upgrade](https://www.royalapplications.com/ts/mac/features-upgrade)

---

<div class="post-metadata">

### Author: ![artur\_zdolinski](https://community.royalapps.com/user_avatar/community.royalapps.com/artur_zdolinski/32/339_2.png) [@artur\_zdolinski](https://community.royalapps.com/u/artur_zdolinski)
#### Post date: [September 10, 2019, 8:23am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/34 "2019-09-10T08:23:35Z")

</div>

_“It will catch “err”, “error” but will also catch “overruns” because it has “err” in it. So it will catch anything with “err” anywhere in the word.”_  
As |^err(\w\*) is not working - you can add space before err and then it will not highlight _overruns_ ie.

(?i)disable(\w\*)|fail(\w\*)| err(\w\*)

---

<div class="post-metadata">

### Author: ![filip\_hasa](https://community.royalapps.com/letter_avatar_proxy/v4/letter/f/96bed5/32.png) [@filip\_hasa](https://community.royalapps.com/u/filip_hasa)
#### Post date: [September 13, 2019, 10:09am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/35 "2019-09-13T10:09:29Z")

</div>

try add \b before word: \b(?i)disable(\w\*)|\bfail(\w\*)|\berr(\w\*)

![image](https://community.royalapps.com/uploads/default/original/1X/95083ea05d44fd3e8ab896e1da2ce21d20dfe646.png)

you are looking for:

![image](https://community.royalapps.com/uploads/default/original/1X/3278610490d9eef3a9bdafd095154f63968b2910.png)

hope this help 😉

Filip

---

<div class="post-metadata">

### Author: ![branko\_zavrl](https://community.royalapps.com/letter_avatar_proxy/v4/letter/b/e19b73/32.png) [@branko\_zavrl](https://community.royalapps.com/u/branko_zavrl)
#### Post date: [February 6, 2020, 5:47pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/36 "2020-02-06T17:47:46Z")

</div>

Since I came to RoyalTS from using Mobaxterm, I was spoiled by its syntax highlighting of words that were built-in. Does anyone have a similar regex and is willing to share, to apply this to RoyalTS?

---

<div class="post-metadata">

### Author: ![james\_julier](https://community.royalapps.com/user_avatar/community.royalapps.com/james_julier/32/422_2.png) [@james\_julier](https://community.royalapps.com/u/james_julier)
#### Post date: [February 13, 2020, 10:37am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/37 "2020-02-13T10:37:07Z")

</div>

I regularly import a new site with 40+ telnet or SSH sessions via a spreadsheet, is there a simple way to apply syntax highlighting on all these new connections? At present it looks like I have to go add the regex, then select the colours. Can be done in Bulk edit, but its still laborious.

---

<div class="post-metadata">

### Author: ![stefan\_koell](https://community.royalapps.com/user_avatar/community.royalapps.com/stefan_koell/32/9_2.png) [@stefan\_koell](https://community.royalapps.com/u/stefan_koell)
#### Post date: [February 13, 2020, 10:49am UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/38 "2020-02-13T10:49:11Z")

</div>

Hi James,

check out the bulk-edit KB here:

> [@Bulk-Edit and the Folder Dashboard (Win)](https://community.royalapps.com/t/bulk-edit-and-the-folder-dashboard-win/275):
>
> This video shows how to change individual settings on multiple objects of the same type. Bulk-Edit also works across different types for common properties. [[YouTube] ](https://www.youtube.com/watch?v=OpUKaFlcMN4)Showing objects from subfolders By default, the folder dashboard only shows objects that are immediate children of the selected folder. If you need to also work with objects in subfolders, enable the setting “Show objects from subfolders” in the context menu of the “Filter” field:

I hope this helps.

Regards,  
Stefan

---

<div class="post-metadata">

### Author: ![filip\_hasa](https://community.royalapps.com/letter_avatar_proxy/v4/letter/f/96bed5/32.png) [@filip\_hasa](https://community.royalapps.com/u/filip_hasa)
#### Post date: [February 13, 2020, 4:23pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/39 "2020-02-13T16:23:46Z")

</div>

Hi James, try to use [sikulix.com](http://sikulix.com) It can automate any clicking 😉 Filip

---

<div class="post-metadata">

### Author: ![filip\_hasa](https://community.royalapps.com/letter_avatar_proxy/v4/letter/f/96bed5/32.png) [@filip\_hasa](https://community.royalapps.com/u/filip_hasa)
#### Post date: [February 13, 2020, 4:25pm UTC](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474/40 "2020-02-13T16:25:30Z")

</div>

one more thing: I expect you can change the default setting for your connection so all new connections will have your requirements. hope this help

[Previous page](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474.md?page=1)

[Next page](https://community.royalapps.com/t/coloring-of-syntax-in-ssh-sessions/474.md?page=3)
