如果在正则表达式中,使用(?打头的纯的,不捕获的group?
gogon 2005-09-12 12:26:27 正则表达式中,用()表示group,而括号内捕获的内容可以供后面使用
但是如果我不想捕获,只不过用()表示纯粹的群组,比如说(abd)+,这里我不想捕获,只是为了表示abdabd而已。怎么办呢?JDK里面有
Groups beginning with (? are pure, non-capturing groups that do not capture text and do not count towards the group total
但是没有例子,具体怎么写?
我实验了(?abc)+,(//?abc)+,(?abc?)+,等,都不行,哪位高手指教一下。