Tags:
create new tag
, view all tags

Question

I would like to search with wildcards for multiple categories in the body text. Maybe there are no wildcards needed... In the first search I wanna find only "Categroy1" and in the second "Category2".

This is how the categories are set in a topic and there are, as in this example, in a table:

Categories: Category1, Categroy2

It's hard to get the right $pattern( ... ) syntax.

Maybe someone can help me out.


Here another issue... I got a topic with following information included in a table, this topic is also assigned to a TWikiForm (Field=TopicClassification, Value=Category1):

Name FirstnameLastname
Phone 012 / 123 - 12345
Mail firstname.lastname@domainPLEASENOSPAM.net
Location City


On a diffrent site I want to extract the above mentioned information:

Name Phone Mail Location
%SEARCH{ "[T]opicClassification.*?value=\"[C]ategory1"" scope="text" regex="on" nosearch="on" nototal="on" format="| $topic | ? | ? | ? | ? |" }

How has the $pattern variable has to look like where the "?" are?

I'm very thankfull for help!

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- ThomasEsau - 20 Nov 2006

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Here is the regex to find just Category2:

Categories: \s*\|.*Category2

On extracting selected content, you need a $pattern() in the format. Untested example to extract Name:

format="| [[$topic]] | $pattern(^\| \s*Name \s*\| \s*([^\|]*).*) | etc. |"

See details in VarSEARCH, FormattedSearch and SearchPatternCookbook.

-- PeterThoeny - 20 Nov 2006

 
Change status to:
Topic revision: r2 - 2006-11-20 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.