Someone help me i have a file containing following
a // true
тодорхойгүй гишүүн\n // false
ямар нэг // false
нэгэн // false
a good deal // true
нэлээн // false
a long face // true
уруу царай // false
...
My java code
while ((strLine = br.readLine()) != null) {
// string from file
Pattern pattern = Pattern.compile("[\\sa-zA-Z]{1,}");
Matcher matcher = pattern.matcher(strLine);
if (matcher.matches()) {
System.out.print(true+ "\n");
} else {
System.out.print(false + "\n");
}
}
Output
false // there is problem this line must true
false
false
false
true
false
true
false
Why first time not match.
I inserted blank line into start of file then output
false
true // this line was false before i insert blank line
false
false
false
true
false
true
false