From bdd92748ab7b183658abdba10a5f93a59faa0c4e Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Tue, 26 Dec 2023 04:53:10 +0100 Subject: [PATCH] Add some backtracking control Not terribly necessary here, because inputs are short, but it's a good practice. I wish there was a way to just disable backtracking for the entire regex since this kind of pattern doesn't need any of it. --- revbank | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/revbank b/revbank index 1ddceeb..314bd7a 100755 --- a/revbank +++ b/revbank @@ -36,10 +36,10 @@ sub split_input($input) { while ( $input =~ m[ - \G \s* - (?| (') ( (?: \\. | [^\\'] )* ) ' (?=\s|;|$) - | (") ( (?: \\. | [^\\"] )* ) " (?=\s|;|$) - | () ( (?: \\. | [^\\;'"\s] )+ ) (?=\s|;|$) + \G \s*+ + (?| (') ( (?: \\. | [^\\'] )*+ ) ' (?=\s|;|$) + | (") ( (?: \\. | [^\\"] )*+ ) " (?=\s|;|$) + | () ( (?: \\. | [^\\;'"\s] )++ ) (?=\s|;|$) | () (;) ) ]xg