Chris
Chris

Reputation: 29

VS Code Highlight syntax

I'm using the Hightlight Extension in VS Code that would markup parts of the code. I have sql models and what I want to do is to highlight when I have a combination at the join level. Eg:

Join table2 T1 ON t1.dbid = t2.dbid

so the pattern would be * join + word + ON + word.dbid = word.dbid

I've tried various combinations but nothing worked perfectly. Even tried a Regex generator.

(?i)^join [a-zA-Z]+ on +[a-zA-Z]+._db_id = [a-zA-Z]+._db_id$

Any ideas?

Upvotes: 0

Views: 108

Answers (1)

Wace
Wace

Reputation: 602

Try this one:

join\s+.*?\s+on\s+[^.]*?\.dbid\s*=\s*[^.]*?\.dbid

Important point: be sure you are not set as "Match case".

↓ tested here ↓

regex101

Upvotes: 1

Related Questions