Can I ask for a help on creating regex for templater ? #1503
-
I need to support this style of placeholder select bar
from bar
where id = :#${qwe} I.e. the placeholder is The best regex I've been to come up with
But it still produces an error and considers == [src/main/resources/sql/upsert-user-daily-balances.sql] FAIL
L: 3 | P: 13 | LT12 | Files must end with a single trailing newline.
| [layout.end_of_file]
select bar
from bar
where id = :
#${qwe} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey, I was looking into this, and I can't seem to get it behave as you describe. I am running this in the playground as it's just easier. With the style select bar
from bar
where id = :#${qwe} and config set to
and it seems to work a treat with the output being
|
Beta Was this translation helpful? Give feedback.
-
Hello @benfdking The dialect is the issue, if I change
Then
|
Beta Was this translation helpful? Give feedback.
So I debugged it with our new template tab in the playground
It turns out you're regex just simply isn't working. I wonder if something is being escaped in the parsing of the config file. That said I have just gone and implemented it.
New config once deployed would be
and #1522 for keeping track.