regex question
hi, with this code (thanks to sabre150) i can find the three first words:
Pattern pattern = Pattern.compile("^(\\w+)\\s+(\\w+)\\s+(\\w+)");
Matcher matcher = pattern.matcher(partDesc);
here, regex has defined what a word is, i would like to set up the definitions for what a word is myself so i started off with something easy:
("^((a-zA-Z+)((\\.a-zA-z)|\\s)) instead of ("^(\\w+)\\s
with this one i'd like it to count capital and lower case a-z followed by a plank space or period+word+blank space as a word. this would include any normal word plus abbreviations such as "e.g".
it does compilate (word?) it alright... however when i run it, the output for this is:
java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:194)
at java.io.DataInputStream.read(DataInputStream.java:134)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at Testar2.main(Testar2.java:23)
Does anyone understand why this won't work? i thought maybe it's my way of describing a period/full stop as \\.
...?
thank you in advance!

