Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Addition to Standard filter | ||||||
---|---|---|---|---|---|---|---|
Product: | Calc | Reporter: | alex_rus <cc> | ||||
Component: | editing | Assignee: | requirements <requirements> | ||||
Status: | CLOSED DUPLICATE | QA Contact: | issues@sc <issues> | ||||
Severity: | Trivial | ||||||
Priority: | P3 | CC: | issues, kami911, kyoshida, niklas.nebel, oc, ooo | ||||
Version: | 680m79 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Issue Type: | FEATURE | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
alex_rus
2005-02-19 22:40:00 UTC
Hi, IMHO this is covered by the regular expresisons, but let's decide requirements about this. Frank Can you help us? *** Issue 57681 has been marked as a duplicate of this issue. *** *** Issue 47093 has been marked as a duplicate of this issue. *** Alexander, I concur. I use the "contain" and "begins with" almost daily in Excel. I have also tried to reproduce them with regular expressions without success. Frank, Please provide guidance to on how to search for a data string using regular expressions. dbadams, To filter for regular expressions choose condition '=', and in the Value field enter for "contains": .*YourSearch.* for "begins with": ^YourSearch.* Note the '.*' dot asterisk expression for "zero or more occurrences of any character" in both terms, and the '^' circumflex accent that anchors a term to the start of a paragraph respectively cell content. To negate a search (does not contain, does not start with) choose the condition '<>'. For further information on regular expressions plese see the online help topic "regular expressions;list of". Eike Thank you, Eike for the information on wildcard characters / regular expressions. Though the functionality is superior to Excel, it is not as user friendly. I think the biggest issue with me it the filter documentation. The use of regular expressions is not linked or referred to in the OOo help text for filters. Now if you all will excuse me, I am about to go play with the expressions. Regards, David (dbadams) Eike, They don't work on standard filters in the filter dialog box. I tried the carat '^', asterisk '*', question mark '?' and period '.' in many combinations on a numberic only field and also on an alpha numberic field in a spreadsheet table. No luck. I checked the box to allow regular expressions before I started. Still, no luck. Eike, They don't work on standard filters in the filter dialog box. I tried the carat '^', asterisk '*', question mark '?' and period '.' in many combinations on a numberic only field and also on an alpha numberic field in a spreadsheet table. No luck. I checked the box to allow regular expressions before I started. Still, no luck. David, Regular expressions _do_ work in the standard filter, but just don't match plain numeric values, which btw is the same for the "starts with" and "contains" in "the other" spreadsheet application. Alphanumeric _is_ matched. And yes, also for the filter dialog the online help refers the regular expressions, if you take a look at the "More>>" section. If your expressions didn't match it may have been that you entered wildcards like you're used to with file names, which is not the same as regular expressions. Note that for "any one character" instead of ? you use . a single dot, and for "zero or more occurences of any character" instead of * you need to enter .* If you need further help with regular expressions please join the users@openoffice.org mailing list and give examples what exactly didn't work. Eike Can you create other way to starts, ends, contains, empty or not than regular expression. It is not so user friendly for beginners... The ximian collection of patches already has a solution. I patched the 2.0.1 source the built on Windows - it works perfectly... Patch: http://ooo.ximian.com/patches/src680/sc-standard-filter-options.diff Hello Kami, Thank you for providing the link to Ximian.com. I went to the web site and went through the .diff file and the read me file. Forgive me, but I cannot figure out how to install this patch. Could you provide step by step instructions? Thank you, dbadams You must have a build system, and you have to rebuild the sc module. I am sad because I screwed up my build system. I will rebuild it as soon as possible and build an English and Hungarian build from the latest developer version ... I took a look at the patch mentioned. I don't like the approach that SC_BEGINS_WITH and SC_ENDS_WITH force the regular expression flag without the user knowing. Doing so alters the semantics of the search string and may result in mismatching results. Instead, if regular expressions are not enabled, ScTable::ValidQuery() should provide the logic needed. Eike Can you power up this patch with your ideas? And can you force it to be in the main stream? It would be very useful... *** Issue 60235 has been marked as a duplicate of this issue. *** Hi Kami, I won't develop a patch for this right now, but the general idea is that in ScTable::ValidQuery() the option bMatchWholeCell and SC_BEGINS_WITH respectively SC_ENDS_WITH are mutually exclusive. So, for example in case of a non-regex search with SC_BEGINS_WITH, disable bMatchWholeCell and if searching the query within a cell string matches, test if the match occured on start of the string. Similar for SC_ENDS_WITH. You get the idea. Eike Created attachment 34087 [details]
improved patch per Eike's comment
kami_ asked me to look into this. This new patch improves upon the earlier one submitted by mmeeks, and reflects Eike's comment. It works both cases of the regex bit being on and off. The dialog class does not force the regex bit to be TRUE when the filter type is either SC_BEGINS_WITH or SC_ENDS_WIDTH (which I think was a bit un-clean implementation). Instead, SC_BEGINS_WIDTH and SC_ENDS_WIDTH differentiate the regex on and off modes, and act accordingly. I think it's cleaner this way. Eike, can you take a look at this patch ? :-) Kohei Copied patch to issue 35579 that is older and has more votes. Let's continue there. *** This issue has been marked as a duplicate of 35579 *** Closing dup. |