scriban icon indicating copy to clipboard operation
scriban copied to clipboard

Finding templated sections in a large text content

Open alperenbelgic opened this issue 11 months ago • 1 comments

I'd like to use scriban to template MS Word document content. I thought using the entire content of a Word document wouldn't be feasible. I am considering finding individual template variable and apply them parsing them individually.

So, what regex would be best to match template variables for scriban format?

Also, I'd love to know if you have any alternative and/or better suggestions for my use case.

( Templated word documents will be prepared by end users and I don't prefer using MS Office/Word specific structures.)

Many thanks to everyone making and contributing to such a great library.

#question

alperenbelgic avatar Feb 28 '24 21:02 alperenbelgic

So, what regex would be best to match template variables for scriban format? Also, I'd love to know if you have any alternative and/or better suggestions for my use case.

Not sure to follow entirely your use case, but Scriban creates a full AST when parsing a Scriban template, so you have access to all this information without regex.

xoofx avatar Mar 04 '24 20:03 xoofx