Dear KNIMErs,
My regex ^$ (in Row filter) doesn't match an empty string as expected - I know it's an empty string because Java snippet
if ($Column 0$=="") {
return null;
} else {
return $Column 0$;
}
followed by missing value filter node *does* work. Am I missing something?
Thanks!
E
thor
September 10, 2013, 10:22am
#2
I see, thanks.
FWIW, odd Java implementations also affect the whitespace character:
http://stackoverflow.com/questions/4731055/whitespace-matching-regex-java
Poster tchrist seems to offer a solution approach which may interest / help you -- I haven't looked at it in detail, though.
Cheers
E
I was struggling with the Java node and matching to e.g. a "dot" at the end of the string. I tried "\.$", ".$", ".\b", "\.\b" I think. For matching to the "dot", the escape character is not needed, which suggests the meta characters are not treated properly.
aborg
September 10, 2013, 9:13pm
#5
I think in Java Snippet node the following the code: "\\.$". (Note the \\ becuase of the String escaping.)
Thanks, the escaping is something that escaped my attention. :-) Will try.
E