All pastes #992838 Raw Edit

Unnamed

public java v1 · immutable
#992838 ·published 2008-04-22 04:20 UTC
rendered paste body
import java.io.*;import java.util.*;import java.util.regex.*;public class PatternApp {  public static void main (String[] args) throws IOException {    FileReader fin = new FileReader("src/word.rtf");    Scanner wordIn = new Scanner(fin);    Pattern emailPattern = Pattern.compile("\\b[A-z0-9._%+-]+@[A-z0-9.-]+\\.[A-z]{2,4}\\b");    String word;    System.out.println("The words as read in");        while(wordIn.hasNext()) {	word = wordIn.next();	Matcher m = emailPattern.matcher(word);	if(m.find())	    System.out.println(m.group());    }  }}