01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Boolean<br />

operations<br />

Tab. 13.1<br />

Examples<br />

196<br />

��<br />

��<br />

��<br />

complex topic that would fill bookshelves. However, we never<strong>the</strong>less<br />

want to try to give you an idea of what <strong>the</strong>y are.<br />

In a RegEx search, <strong>the</strong>re is also <strong>the</strong> option of using Boolean operations:<br />

Expression Result<br />

Term1;Term2 AND operation. Both terms must be present.<br />

This operator is specific to TWiki.<br />

Term1|Term2 OR operation. At least one of <strong>the</strong> terms must be<br />

found.<br />

!Term1 NOT operation. The term entered must not appear<br />

in <strong>the</strong> document.<br />

(expression) Collection of several expressions to make a single<br />

unit having processing priority.<br />

There are a few more points to remember. First of all, make sure you<br />

do not insert any spaces. They are not ignored in RegEx, but ra<strong>the</strong>r<br />

processed along with <strong>the</strong> rest. That means if <strong>the</strong>re is a space before a<br />

term, <strong>the</strong> character string “term” will be searched. Secondly, as <strong>the</strong><br />

above table shows, words can be collected into a single unit using<br />

paren<strong>the</strong>ses; <strong>the</strong>se will be processed first. The order of <strong>the</strong> expression<br />

priority is PARENTHESES before NOT before AND before<br />

OR. Thirdly, employing brackets also enables unlimited nesting of<br />

expressions. This option facilitates very complex searches.<br />

A few examples will illustrate <strong>the</strong> functions described. For instance,<br />

<strong>the</strong> word<br />

torch|torches<br />

is not only searched in <strong>the</strong> singular, but also in <strong>the</strong> plural. We can<br />

combine <strong>the</strong>m to search for torchlights as well:<br />

torch(light|lights)<br />

Note that <strong>the</strong> entire term will be searched as one unit. Thus, pages<br />

containing just “torch” or just “light” will be ignored. A search for a<br />

torchlight from a flaming torch, excluding light from a flashlight,<br />

which in British English is called an (electric) torch, might look like<br />

this:<br />

torch(light|lights);!electric<br />

13 Searching in TWiki

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!