protected String findPattern ( String strPattern , String text , int grp ) { Pattern pattern = Pattern . compile ( strPattern , Pattern . MULTILINE ) ; Matcher matcher = pattern . matcher ( text ) ; if ( matcher . find ( 0 ) ) return matcher . group ( grp ) ; return null ; }
Find the first occurence ofa pattern in a piece of text and return a specific group .