@ Override public Map < String , String > namedGroups ( ) { Map < String , String > result = new LinkedHashMap < String , String > ( ) ; if ( matcher . find ( 0 ) ) { for ( String groupName : parentPattern . groupNames ( ) ) { String groupValue = matcher . group ( groupIndex ( groupName ) ) ; result . put ( groupName , groupValue ) ; } } return result ; }
Finds all named groups that exist in the input string . This resets the matcher and attempts to match the input against the pre - specified pattern .