I'm having the following problem with regex: I've written a program that reads words from some text (txt) files and writes into another file, writing one word per line.
Everything works fine, except if the word read has a special characters ľščťžýáíé
in it. The regex deletes the char and splits the word where the special char was.
For Example :
Input:
I am Jožo.
Output:
I
am
Jo
o
Here's a snippet of the code:
while( (line = br.readLine())!= null ){
Pattern p = Pattern.compile("[\\w']+");
Matcher m = p.matcher(line);
}