Pattern: compile('d.*ian') : Pattern « java.util.regex « Java by API






Pattern: compile('d.*ian')

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MainClass {
  public static void main(String[] args) {
    Pattern myRE = Pattern.compile("d.*ian");
    Matcher matcher = myRE.matcher("danian devonian dan");
    matcher.lookingAt();
    String result = matcher.group(0);
    System.out.println(result);
  }
}

           
       








Related examples in the same category

1.Pattern.CANON_EQ
2.Pattern.CASE_INSENSITIVE
3.Pattern: compile('(\\w+)\\s(\\d+)')
4.Pattern: compile('e.+?d')
5.Pattern: compile('[a-z]+')
6.Pattern: compile(String text)
7.Pattern: matcher(String text)
8.Pattern: split(String str)