it works fine for my test cases? is there an edge case i am missing, or what can you tell me is wrong with my code?
package com.codegym.task.task19.task1923;
/*
Words with numbers
*/
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Solution {
public static void main(String[] args) throws IOException {
String file1 = args[0];
String file2 = args[1];
try (BufferedReader input = new BufferedReader(new FileReader(file1));
FileWriter output = new FileWriter(file2)) {
while (input.ready()) {
Matcher m = Pattern.compile("\\b.*\\d.*\\b").matcher(input.readLine());
while (m.find()) output.write(m.group() + " ");
}
}
}
}