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
--
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
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
--
JosMaccabiani - 19 Jun 2005