First occurrence
Matching a first occurrence in a string is the most common use-case.
About first()#
You can get the first occurrence of a pattern in a subject by calling first().
Match details#
With Detail and match(), you can gain access to useful information about the matched occurrence.
You can read more extensively about it on Detail page.
Groups in match#
Retrieving capturing groups from a match is really simple.