Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Regular Expression for Nattable Filter
Regular Expression for Nattable Filter [message #1448268] Sun, 19 October 2014 17:42 Go to next message
Mohamed SADI is currently offline Mohamed SADIFriend
Messages: 38
Registered: December 2013
Member
Hello,

I have a nattable column filter with RegularExpression Text Matching Mode, but when i filter with a regular expression, nattble give me no result.

for example the filter is : ^someString so i want to retreive all lines that doesn't conatins the string : "someString".

How should i resolve this problem ?

Thanks in advance

[Updated on: Sun, 19 October 2014 17:43]

Report message to a moderator

Re: Regular Expression for Nattable Filter [message #1448295 is a reply to message #1448268] Sun, 19 October 2014 18:43 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
hm, I'm not 100% sure, but doesn't your statement say "not s" + "omeString" ... shouldn't it be ^(someString)?
Re: Regular Expression for Nattable Filter [message #1448672 is a reply to message #1448295] Mon, 20 October 2014 09:14 Go to previous messageGo to next message
Mohamed SADI is currently offline Mohamed SADIFriend
Messages: 38
Registered: December 2013
Member
No i trayed ^(someString), but no result, can you give me an example of regular expression that work in nattable string column ?
Re: Regular Expression for Nattable Filter [message #1448725 is a reply to message #1448672] Mon, 20 October 2014 10:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I think you should get familiar with regular expressions in Java.

http://docs.oracle.com/javase/tutorial/essential/regex/index.html

But for example [^L]* will find any string that doesn't contain a L
Re: Regular Expression for Nattable Filter [message #1448758 is a reply to message #1448725] Mon, 20 October 2014 11:55 Go to previous messageGo to next message
Mohamed SADI is currently offline Mohamed SADIFriend
Messages: 38
Registered: December 2013
Member
You can say that i am not familiar with advanced regular expression in Java but basic regular expression there no problem, i've tested a basic one but nattable filter give no result, for example \w+ should give all the nattable recode (in my case) but it returns no result
Re: Regular Expression for Nattable Filter [message #1448770 is a reply to message #1448758] Mon, 20 October 2014 12:16 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Funny, because if I modify the _6031_GlazedListsFilterExample to set the matching mode of the lastname column to regular expression doing this

configRegistry.registerConfigAttribute(
                    FilterRowConfigAttributes.TEXT_MATCHING_MODE,
                    TextMatchingMode.REGULAR_EXPRESSION, DisplayMode.NORMAL,
                    FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
                    + DataModelConstants.LASTNAME_COLUMN_POSITION);


Your filter expression is working as expected.
Re: Regular Expression for Nattable Filter [message #1448833 is a reply to message #1448770] Mon, 20 October 2014 14:04 Go to previous message
Mohamed SADI is currently offline Mohamed SADIFriend
Messages: 38
Registered: December 2013
Member
oh Sorry Embarrassed , it was my mistake, beacause i was checking a source code that has TextMatchingMode.REGULAR_EXPRESSION, but the real running example was with a TextMatchingMode.STARTS_WITH, by the way this regular expression ^((?!sometring).)*$ find all record that doesn't have "someString" substring in the desired column. Razz

Thank you again for your quick responses

[Updated on: Mon, 20 October 2014 14:10]

Report message to a moderator

Previous Topic:Populate Table From Database
Next Topic:Displaying composite in NaTable cell
Goto Forum:
  


Current Time: Fri Mar 05 20:34:21 GMT 2021

Powered by FUDForum. Page generated in 0.02206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top