Regular Expression Group Count: (/d{4})-(/d{2}-(/d/d))
How many groups are there in the regular expression (//d{4})-(//d{2}-(//d//d))?/n/nA. 4/n/nB. 3/n/nC. 5/n/nD. 1/n/nAnswer: B. 3/n/nThere are three groups in this regular expression, as indicated by the use of parentheses. The first group (//d{4}) matches four consecutive digits, the second group (//d{2}) matches two consecutive digits, and the third group (//d//d) matches two consecutive digits. The hyphens and parentheses themselves are not considered part of the groups.
原文地址: https://www.cveoy.top/t/topic/odTu 著作权归作者所有。请勿转载和采集!