Tags:
create new tag
view all tags

SID-00305: Use Wildcard .* in %SEARCH

Status: Answered Answered TWiki version: 4.1.2 Perl version: 5.8.8-14.7
Category: CategorySearch Server OS: SLES 10 SP2 X86 64 Last update: 16 years ago

Each topic in one of my webs has a table at last looking like

| *Qualitätssicherung* | *J/N* | *IV* | *VI* | *X* | *XI* | *XIII* | *XVI* | *XVII* | *PS* | *Durchgeführt von, am* |
| QS | | | | X | | | XVI | XVII | | Main.PeterStarek - 02 Dec 2008 |

The last line is variable an can also look like

| QS | | | | | | | XVI | | | Main.PeterStarek - 02 Dec 2008 |
| QS | J | | | | | | XVI | | | Main.PeterStarek - 02 Dec 2008 |
| QS | | | X | | | | | | | Main.PeterStarek - 02 Dec 2008 |
| QS | | | | | | | XVI | | PS | Main.PeterStarek - 02 Dec 2008 |
| QS | | | | X | | | XVI | XVII | | Main.PeterStarek - 02 Dec 2008 |

Now I have to find all topics where a line starts with

| QS | |

and then anywhere in the same line

| XVI |

so I get all topics that needs a QS from XVI (in the examples before I want to get topics that contains one of the lines 1, 4 or 5 - not 2 because there is J after QS and not 3 because there is no XVI)

I tried

%SEARCH{"| QS | |.*| XVI |.*" nosearch="on" excludetopic="*Template*" nosummary="on" format=" * [[$topic]]"}%

but it didn't work. And with the option regex="on" or type="regex" I get all topics of my web, not only the requested.

-- PeterStarek - 2009-05-08

Discussion and Answer

You need to apply a RegularExpression pattern, with properly escaped special characters. The search becomes:
"^\| QS \|.*\| XVI \|"

Demo with narrowing down search to this page only:

For these types of deployments it might be more flexible to create a full blown TWiki forms based application.

More at VarSEARCH, FormattedSearch, TWikiForms, TWikiTemplates.

-- PeterThoeny - 2009-05-08

Sorry, but I don't understand the meaning of ^ and \ in the search-string, but I tried and it doesn't work. Maybe because in my "original" search-string there are .* twice.

But in the meantime, I get another solution for my problem, so the solution for this question is only nice to have, but not really needed.

-- PeterStarek - 2009-05-11

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Use Wildcard .* in %SEARCH
SupportCategory CategorySearch
TWiki version 4.1.2
Server OS SLES 10 SP2 X86 64
Web server Apache 2.2.3-16.18
Perl version 5.8.8-14.7
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2009-05-11 - PeterStarek
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.