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 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.

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:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-11-20 - PeterThoeny
 
  • 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.