正则表达式使用案例-OCP试题
发布时间:2020-12-14 01:30:42 所属栏目:百科 来源:网络整理
导读:92. Evaluate the following expression using meta. character for regular expression: '[^Ale|ax.r$]' Which two matches would be returned by this expression? (Choose two.) A. Alex B. Alax C. Alxer D. Alaxendar E. Alexender Answer: DE 解析:题
92. Evaluate the following expression using meta. character for regular expression:
'[^Ale|ax.r$]' Which two matches would be returned by this expression? (Choose two.) A. Alex B. Alax C. Alxer D. Alaxendar E. Alexender Answer: DE 解析:题目的意思是哪两个选项能和'[^Ale|ax.r$]'匹配 '[^Ale|ax.r$]'中^表示只匹配不在集合{'A','l','e','|','a','x','.','r','$'}中的字符,此处的'|'、'.'、'$'只是表示普通的字符,而非匹配符 select regexp_instr('Alex','[^Ale|ax.r$]') from dual; REGEXP_INSTR('ALEX','[^ALE|AX.R$]') ----------------------------------- 0 select regexp_instr('Alax','[^Ale|ax.r$]') from dual; REGEXP_INSTR('ALAX','[^ALE|AX.R$]') ----------------------------------- 0 select regexp_instr('Alxer','[^Ale|ax.r$]') from dual; REGEXP_INSTR('ALXER','[^ALE|AX.R$]') ------------------------------------ 0 select regexp_instr('Alaxendar','[^Ale|ax.r$]') from dual; REGEXP_INSTR('ALAXENDAR','[^ALE|AX.R$]') ---------------------------------------- 6 select regexp_instr('Alexender','[^Ale|ax.r$]') from dual; REGEXP_INSTR('ALEXENDER','[^ALE|AX.R$]') ---------------------------------------- 6 因此可见答案是DE 转自:http://www.itpub.net/forum.php?mod=viewthread&tid=1327778 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |