Randall Twede wrote:as far as i can see my code is exactly like the tutorial except i use the other Pattern constructor
it compiles but i get a NullPointerException at Matcher.getTextLength(unknown source)
My first impression is that
text is null. getText() of Swing text components
can return a null (see documentation) ... why you are eventually in this situation ... I don't know without seeing the rest of the code.