The match function searches for a string/regular expression in the specified string. Here, the string in which the match will search is given as the first argument and the regular expression to be matched is given as the second argument. The match function returns the starting position of the substring (the longest match string) that was matched by the regular expression.
This function also sets the following two AWK variables in the following ways:
- RSTART: This is set up to contain the starting value returned by the function that is the starting position of the substring. If the pattern does not match, RSTART is set to 0.
- RLENGTH: This is set up to contain the length of the search string. It is set to ...