PatternDecimal.java

import java.util.regex.*;
public class PatternDecimal {
  public static void main(String[] args) {
    Pattern p = Pattern.compile("(\\d+\\.\\d*([eE][+-]?\\d+)?[fFdD]?)" +
                "|(\\.\\d+([eE][+-]?\\d+)?[fFdD]?)" +
                "|(\\d+[eE][+-]?\\d+[fFdD]?)" +
                "|(\\d+([eE][+-]?\\d+)?[fFdD])");
    Matcher m = p.matcher("abc1.25e-3def1.+15ghi+1.2E-15Fj");
    for (int nb=0; m.find(); ++nb) 
      System.out.println("Occurrence " + nb + " : " + m.group());
  }
}