( begin auto-generated from match.xml ) The match() function is used to apply a regular expression to a piece of text, and return matching groups (elements found inside parentheses) as a String array. No match will return null. If no groups are specified in the regexp, but the sequence matches, an
(String str, String regexp)
| 9307 | * @see PApplet#trim(String) |
| 9308 | */ |
| 9309 | static public String[] match(String str, String regexp) { |
| 9310 | Pattern p = matchPattern(regexp); |
| 9311 | Matcher m = p.matcher(str); |
| 9312 | if (m.find()) { |
| 9313 | int count = m.groupCount() + 1; |
| 9314 | String[] groups = new String[count]; |
| 9315 | for (int i = 0; i < count; i++) { |
| 9316 | groups[i] = m.group(i); |
| 9317 | } |
| 9318 | return groups; |
| 9319 | } |
| 9320 | return null; |
| 9321 | } |
| 9322 | |
| 9323 | |
| 9324 | /** |
no test coverage detected