Revision: 16201
Updated Code
at July 28, 2009 19:06 by aadsm
Updated Code
import java.util.regex.Matcher; import java.util.regex.Pattern; // Java -has- issues public String[] getMatches( String string, String regexp ) { String[] matches = new String[0]; Pattern pattern = Pattern.compile(regexp); Matcher matcher = pattern.matcher(string); boolean matchFound = matcher.find(); if( matchFound ) { matches = new String[matcher.groupCount()]; for( int i = 0; i <= matcher.groupCount(); i++ ) { matches[i] = matcher.group(i); } } return matches; }
Revision: 16200
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 28, 2009 19:02 by aadsm
Initial Code
// Java -has- issues public String[] getMatches( String string, String regexp ) { String[] matches = new String[0]; Pattern pattern = Pattern.compile(regexp); Matcher matcher = pattern.matcher(string); boolean matchFound = matcher.find(); if( matchFound ) { matches = new String[matcher.groupCount()]; for( int i = 0; i <= matcher.groupCount(); i++ ) { matches[i] = matcher.group(i); } } return matches; }
Initial URL
Initial Description
Initial Title
Missing getMatches function
Initial Tags
regexp
Initial Language
Java