1
0
Fork 0

Regex simplifications

pull/10072/head
Jordi Boggiano 2021-08-23 22:18:03 +02:00
parent 3f79e59f69
commit 6ab1b6a7d2
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 10 deletions

View File

@ -253,20 +253,13 @@ class ClassMapGenerator
(?:\r\n|\n|\r) (?:\r\n|\n|\r)
# the meat of it, matching line by line until end delimiter # the meat of it, matching line by line until end delimiter
(?: (?:
# a valid line is either.. # a valid line is optional white-space (possessive match) not followed by the end delimiter, then anything goes for the rest of the line
(?: [\t ]*+(?!\\2 [\t \r\n]*[;,.)])[^\r\n]*
# non-word or non-space char, then anything goes for the rest of the line
[^\s\w][^\r\n]+
# white-space (possessive match) not followed by the end delimiter, then anything goes for the rest of the line
| \s*+(?!\\2 \s*[;,.)])[^\r\n]+
# white-space but no new lines
| [\t\f\v ]+
)
# end of line(s) # end of line(s)
[\r\n]+ [\r\n]+
)* )*
# end delimiter # end delimiter
\s* \\2 (?=\s*[;,.)]) [\t ]* \\2 (?=[\t \r\n]*[;,.)])
}x', 'null', $contents); }x', 'null', $contents);
// strip strings // strip strings