[網路考古題] A002

問:What is the offset past match output node of Match Pattern VI?

 

 

選項:
A. Index of the next match relative to the previous match in input string if multiple matches exist
B.  Index in input string of the first character of the after substring output node
C. Index of the next match relative to the first character in input string if multiple matches exist
D. Index in input string of the first character of the match substring output node


答案:C

說明:

offset past match is the index in string of the first character of after substring. If the function does not find a match, offset past match is –1. The offset input and the offset past match output might be equal when the empty string is a valid match for the regular expression. For example, if regular expression is b* and the string input is cdb, offset past match is 0. If string is bbbcd, offset past match is 3.