fix: invalid regex
This commit is contained in:
parent
8ce3a6b4e3
commit
b39d60f46c
1 changed files with 1 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ class Template(template: String) {
|
|||
val result: StringBuilder = StringBuilder(template)
|
||||
|
||||
fun replaceVariable(name: String, value: String) {
|
||||
val regex = Regex("{{\\s?$name\\s?}}")
|
||||
val regex = Regex("\\{\\{\\s?$name\\s?}}")
|
||||
val range = regex.find(result)!!.range
|
||||
|
||||
result.replace(range.first, range.last + 1, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue