[Lexer] Prevent the regex from being greedy
This commit is contained in:
@@ -10,7 +10,7 @@ import Foundation
|
||||
|
||||
public struct Lexer {
|
||||
public let templateString:String
|
||||
let regex = NSRegularExpression(pattern: "(\\{\\{.*\\}\\}|\\{%.*%\\}|\\{#.*#\\})", options: nil, error: nil)
|
||||
let regex = NSRegularExpression(pattern: "(\\{\\{.*?\\}\\}|\\{%.*?%\\}|\\{#.*?#\\})", options: nil, error: nil)
|
||||
|
||||
public init(templateString:String) {
|
||||
self.templateString = templateString
|
||||
|
||||
Reference in New Issue
Block a user