7 lines
149 B
Java
7 lines
149 B
Java
|
|
import java.util.regex.*;
|
||
|
|
Pattern p = Pattern.compile("a*b");
|
||
|
|
Matcher m = p.matcher(str);
|
||
|
|
while (m.find()) {
|
||
|
|
// use m.group() to extract matches
|
||
|
|
}
|