private List < Integer > extractRgroups ( String data ) { Pattern pattern = Pattern . compile ( "R[1-9]\\d*" ) ; Matcher matcher = pattern . matcher ( data ) ; List < Integer > listValues = new ArrayList < Integer > ( ) ; while ( matcher . find ( ) ) { listValues . add ( Integer . parseInt ( matcher . group ( ) . split ( "R" ) [ 1 ] ) ) ; } return listValues ; }
extract Rgroups from extended smiles