-
Notifications
You must be signed in to change notification settings - Fork 523
Regex parsing fixes for newline characters and marker verbs #3268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,6 +518,12 @@ function bug11323(string $s): void { | |
if (preg_match('{([^1-4])}', $s, $matches)) { | ||
assertType('array{string, non-empty-string}', $matches); | ||
} | ||
if (preg_match("{([\r\n]+)(\n)([\n])}", $s, $matches)) { | ||
assertType('array{string, non-empty-string, non-empty-string, non-empty-string}', $matches); | ||
} | ||
if (preg_match('/foo(*:first)|bar(*:second)([x])/', $s, $matches)) { | ||
assertType("array{0: string, 1?: non-empty-string, MARK?: 'first'|'second'}", $matches); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should MARK be non-optional since we are sure here about the successfull match? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left it as such because it depends where the mark is https://3v4l.org/vJofm - and it seems to me not really worth the effort to ensure whether it's in a match group that is optional or not, given how niche this feature is. |
||
} | ||
} | ||
|
||
function (string $s): void { | ||
|
Uh oh!
There was an error while loading. Please reload this page.