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.
This commit is contained in:
parent
0d3866a881
commit
bdd92748ab
1 changed files with 4 additions and 4 deletions
8
revbank
8
revbank
|
@ -36,10 +36,10 @@ sub split_input($input) {
|
||||||
|
|
||||||
while (
|
while (
|
||||||
$input =~ m[
|
$input =~ m[
|
||||||
\G \s*
|
\G \s*+
|
||||||
(?| (') ( (?: \\. | [^\\'] )* ) ' (?=\s|;|$)
|
(?| (') ( (?: \\. | [^\\'] )*+ ) ' (?=\s|;|$)
|
||||||
| (") ( (?: \\. | [^\\"] )* ) " (?=\s|;|$)
|
| (") ( (?: \\. | [^\\"] )*+ ) " (?=\s|;|$)
|
||||||
| () ( (?: \\. | [^\\;'"\s] )+ ) (?=\s|;|$)
|
| () ( (?: \\. | [^\\;'"\s] )++ ) (?=\s|;|$)
|
||||||
| () (;)
|
| () (;)
|
||||||
)
|
)
|
||||||
]xg
|
]xg
|
||||||
|
|
Loading…
Add table
Reference in a new issue