I can search on every column except Number. I cannot search number column. Because I have given the regex as
RowFilter<MyTableModel, Object> rf = null;
//If current expression doesn't parse, don't update.
try {
rf = RowFilter.regexFilter(filterText.getText(), 0,1,2,3,4);
} catch (java.util.regex.PatternSyntaxException e) {
return;
}
sorter.setRowFilter(rf);
Can anybody help me to find the correct Regex. The current Regex is not working for ‘+’. If i print the exception it will shows
meta character '+' near index 0 (java.util.regex.PatternSyntaxException)
I can search the current table columns except number using RowFilter.regexFilter(filterText.getText(), 0,1,2,3,4); this regex.
FirstName LastName Number
Karthy Smith +123
John Doe +234
Sue Black +545
Jane White +895reading
try
as
filter.getText()may (and in your case does) contain regex meta characters or escape sequences, they lose their special meaning usingPattern.quote().