From: Dmitrii PapaGeorgio Date: 2002-12-09T05:00:29+09:00 Subject: Please help converting my Java program I know I'm going to use print $a.gsub /,?\s\s+/, "\n" for the regular expression, could someone help me convert this to RUBY? import java.io.*; public class ParserX { public ParserX() { /* String s = "Disregarded Entities: The International Tax Aspects\n" + "by R. Peroni, ABA Tax Section 2002\n" + ".ns;title(disregarded entities w/3 international)\n" + "Disregarded Entities: The International Tax Aspects\n" + "by R. Peroni, ABA Tax Section 2002\n" + ".ns;title(disregarded entities w/3 international)"; */ String s; try { s = readFile("ohoh2.txt"); String[] lines = s.split("(?:[ ]{5}[ ]*)|\\n"); for (int i = 0; i < lines.length; i++) { System.out.println(lines[i]); } } catch (Exception e) { e.printStackTrace(); } } private static String readFile(String filename) throws IOException { String lineSep = System.getProperty("line.separator"); BufferedReader br = new BufferedReader(new FileReader(filename)); String nextLine = ""; StringBuffer sb = new StringBuffer(); while ((nextLine = br.readLine()) != null) { sb.append(nextLine); // // note: // BufferedReader strips the EOL character. // sb.append(lineSep); } return sb.toString(); } public static void main(String[] args) { ParserX readFileContents1 = new ParserX(); } }