Expand description
§{:contains; … :}
Outputs code only if the haystack contains the needle.
§Usage:
{:contains; /haystack/needle/ >> code :}
{:contains; /literal/literal/ >> code :}
{:contains; /{:;varname:}/42/ >> ... :}
Any delimiter can be used:
{:contains; ~haystack~needle~ >> ... :}
{:contains; #haystack#needle# >> ... :}
{:contains; |haystack|needle| >> ... :}
{:contains; XhaystackXneedleX >> ... :}
If the haystack contains the needle, the code block is rendered. Otherwise, nothing is output.
§Modifiers:
{:^contains; ... :}
{:!contains; ... :}
§Modifier: ^ (upline)
Removes preceding whitespace before output. See “unprintable” for more details.
§Modifier: ! (not)
Negates the condition. Outputs code only if the haystack does NOT contain the needle.
{:!contains; /haystack/needle/ >> shown if not contains :}
§No flags
§Examples
Basic usage:
{:contains; /hello/world/ >> This will not show :}
{:contains; /hello/lo/ >> This will show :}
With variables:
{:contains; /{:;varname:}/needle/ >> Output if varname contains 'needle' :}
With negation:
{:!contains; /abc/xyz/ >> Shown because 'abc' does not contain 'xyz' :}