Tags:
create new tag
view all tags

Question

I have several topics with many form definition tables, i.e. they define select menu items in a form template. They are formatted like:

| *Name* | *Type* | *Tooltip message* |
| Kies... | option | |
| aardbeving | option | |
| adsorptie | option | |

I'd like to be able to extract the 'name' values to put them in a select input. Can this be accomplished by a search? What kind of pattern would be needed?

If this is not possible with a SEARCH, what strategy should I adopt? Thanks!

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RedHat 9 Enterprise
Web server: Apache 1.3.33
Perl version: 5.8.5
Client OS: Win2k
Web Browser: IE6
Categories: Search

-- JosMaccabiani - 15 Jun 2005

Answer

Use a FormattedSearch with multiple="on". Building a <select> with your example: (view raw text to see how)

-- PeterThoeny - 16 Jun 2005

Wow, thanks Peter, that works perfectly. Is there 'TWiki.SearchPattern repository' that we can add this to? (It's probably obvious to most of you, but a lifesaver when you're new to regexes like me.)

-- JosMaccabiani - 16 Jun 2005

I think a search pattern repository is a great idea! Regex are such an important part of tapping TWiki's full potential and yet are incredibly obscure to the uninitiated. After three years of playing with them, I'm beginning to understand them (almost to my own surprise) but still, I mostly do cut and paste (and maybe tweak) from existing examples. so having lots of examples together would be very useful. How about SearchPatternExamples?

-- LynnwoodBrown - 16 Jun 2005

or how about TWiki.SearchPatternCookbook?

-- WillNorris - 16 Jun 2005

I like the idea of a cookbook smile

Also, it might be good to add some samples to the sample application section in the Sandbox web (once restored)

-- PeterThoeny - 18 Jun 2005

Started the page SearchPatternCookbook as suggested. Please add your useful TWiki search patterns to this page for the benefit of people like me and even LynnwoodBrown wink

-- JosMaccabiani - 19 Jun 2005

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-06-19 - JosMaccabiani
 
  • 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.