We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example: (list of people, some with ages)
Clark, Brian 23, Olivia, Jane 24, Marcin 26
New API:
pattern('[a-z]+(?: (?<age>\d+))?')->match($s)->group('age')->first();
GroupNotMatchedException
The text was updated successfully, but these errors were encountered:
Right now, the only way to conrol both match and might be group:
pattern('xd')->match($subject) ->forFirst(function (Match $match) { $match->group('age')->orElse(); // subject matched, group not $match->group('age')->orReturn(); $match->group('age')->orThrow(); }) ->orDefault('Nothing');
Sorry, something went wrong.
Add tests for ->first() and ->only (#10)
fec0a70
->first() never returns null (#10)
ea67cdc
No branches or pull requests
Example: (list of people, some with ages)
New API:
GroupNotMatchedException
if subject matched, but group wasn't.The text was updated successfully, but these errors were encountered: