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 (
|
||||
$input =~ m[
|
||||
\G \s*
|
||||
(?| (') ( (?: \\. | [^\\'] )* ) ' (?=\s|;|$)
|
||||
| (") ( (?: \\. | [^\\"] )* ) " (?=\s|;|$)
|
||||
| () ( (?: \\. | [^\\;'"\s] )+ ) (?=\s|;|$)
|
||||
\G \s*+
|
||||
(?| (') ( (?: \\. | [^\\'] )*+ ) ' (?=\s|;|$)
|
||||
| (") ( (?: \\. | [^\\"] )*+ ) " (?=\s|;|$)
|
||||
| () ( (?: \\. | [^\\;'"\s] )++ ) (?=\s|;|$)
|
||||
| () (;)
|
||||
)
|
||||
]xg
|
||||
|
|
Loading…
Add table
Reference in a new issue