From: SourceForge.net <no...@so...> - 2003-12-04 20:50:48
|
Bugs item #831264, was opened at 2003-10-27 11:40 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=831264&group_id=588 Category: search and replace Group: severe bug Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: regex matches incorrect criteria, throws exceptions Initial Comment: I've got a textfile of book records including ISBNs which I want to strip down to nothing but the ISBNs delimited by newlines. In its original format none of the lines begin with digits. The first regex ([[:digit:]X]{10}) and its replace expression \n$1\n works properly (putting each ISBN on its own line), but the next one: ^[^[:digit:]][[:print:]]+\n (to be replaced with a blank) is supposed to only match lines which do not start with a digit and delete them, leaving only the lines with ISBNs and some extra newlines to be removed later. When I run the second regex it deletes the first five lines with ISBNs in them -- this doesn't happen in TextPad. If I run the regex one Find at a time without Replace it throws a java.lang.NullPointerException error four times before matching a non-ISBN line (and it matches the second line instead of the first line which also meets the criteria). The next regex, replace \n\n with \n, deletes another three rows of ISBNs from the top of the document instead of merely stripping extra newlines. Running the regex one Find at a time results in the same error being thrown four times before it matches the *second* instance of the correct match instead of the first. Again, these regexes have run correctly in TextPad so I'm confident they're stable expressions. I wanted to demonstrate this automation using jEdit at a state library conference in December but obviously there's a problem here. My instance of Java is about as new as it gets, so I'm hoping it isn't the problem here (I'll test it at home under OS X to see if it reproduces). --andrew dot roazen at nau dot edu ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2003-12-04 12:50 Message: Logged In: NO On Slava's advice I reinstalled JEdit and the problem disappeared. Perhaps the previous version was corrupted somehow. --Andrew ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=831264&group_id=588 |