First, your regex is not what you want.
Square brackets list alternative characters (e.g., "[abc]" matches "a", "b" or "c"). ".*" matches any sequence of characters ("." = any one character, "*" = previous character 0 or more times). But "[.*]" matches only the literal character "." OR the literal character "*" because the square-brackets don't support wildcarding inside. This is an even bigger problem for the middle of your regex "[\\w^_{5}]" (that matches the literal character backslash, w, caret, underscore, {, 5, or }... but nothing else. Definitely not what you are looking for.
The upshot is that the string "*w*" matches your regular expression (as do strings like ".{." and ".5*"), but strings that you probably want to match (such as "abcde") do not.
You want to use \w (a word character) and \W (a non-word character) to construct your regex... but not in square brackets. Taking your original description literally, you want lines that contain exactly 5 word characters (supposedly with any number of non-word characters before, after, or in between them). That would be a regex like:
^\W*(\w\W*){5}$
You use the "^" anchor to ensure that the pattern includes the very first character (otherwise the pattern could skip over some word characters, and match 5 word characters in the middle of your String). Start the String with any number of non-word characters (\W*). Then one word character (\w) followed by any number of non-word characters (\W*) -- the whole thing repeated exactly 5 times ({5}). Then the end-of-line anchor ($) for the same reason as the caret. That's the regex for exactly 5 word characters with any number of non-word characters in any position.
Note that in Java String instances, backslashes escape other things. So you have to double all the backslashes when entering that regex as a constant String, in order to get a single backslash into the regex.
Then, by the way, it is sufficient to call only "scan.findInLine()" which returns the string that matches the regex, or null if there is no match. You don't need to worry about MatchResult.
Here's a simple test program that I wrote, and the results of testing it with several Strings:
=====
public static void main( String[] args ) {
doTest("abcde");
doTest(" a b c d e ");
doTest(" a b c ");
doTest(" abcdef ");
doTest("*w*");
}
public static void doTest( String s ) {
System.out.println("Testing \"" + s + "\"");
Scanner scan = new Scanner(s);
String s2 = scan.findInLine( "^\\W*(\\w\\W*){5}$" );
scan.close();
if (s2 != null) {
System.out.println("Found in line");
} else {
System.out.println("Not in line");
} }
=====
And here is the output of my little test program, annotated (// my comments):
=====
Testing "abcde" // only 5 word characters
Found in line
Testing " a b c d e " // 5 word characters with non-word in between
Found in line
Testing " a b c " // only 3 word characters
Not in line
Testing " abcdef " // 6 word characters
Not in line
Testing "*w*" // test for your original expression
Not in line
=====
Combine that with the file I/O stuff you already wrote, and you should have the program you want.