cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Topic Markup Language and applications: Answered

%INCLUDE using a pattern

Including a table from a different topic using %!INCLUDE{"topic" pattern="..."}

I want to include a table which is created via CommentPlugin and FormPlugin and hide it inside the including topic with a html comment. Because both Plugins create html comments itself and I can not extract the table with %!STARTINCLUDE% I tried various patterns.

My basic question is, which pattern does match any line of a TML table:
| *sometext* | *nextrow* |
| val1 | text1 |
and so on.

Some of my ideas included the following regexes (these are just the siple ones):
(|.*|)
(^|.*|$)
(|.*|.*|)
(?m^|.*|$)
\n(|.*|\n)
\n(|.*|.*|\n)

None of them gave me any match in the included topic. As far as I got the Regex syntax right most of them should match the table. Why don't the behave like expected?

Hi there,

I cannot know for sure, but I suspect you need to escape the veritcal bar |. The vertical bar is a special character in a regex (OR).

  • This regex
    (|.*|)
    matches nothing OR everything OR nothing.

  • This regex
    (\|.*\|)
    matches vertical bar followed by everything followed by vertical bar.

-- BramVanOosterhout - 19 Jul 2013

QuestionForm edit

Subject Topic Markup Language and applications
Extension
Version Foswiki 1.1.3
Status Answered
Related Topics
Topic revision: r3 - 12 Jan 2015, LynnwoodBrown - This page was cached on 17 Jul 2018 - 06:41.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy