# Teletext

Zapping has a built-in Teletext viewer called Zapzilla.

## Zapzilla

Zapzilla window. Contains titlebar, menubar, toolbar, display area showing a Teletext page, and statusbar. The menubar contains File, Edit, View, Go, Channels and Bookmarks menus.

The Zapzilla window contains a menu, toolbar and a context menu which opens when you click on the page with the right mouse button.

## Zapzilla Context Menu

Context menu with New window, Save as, Search, Colors, Subtitles, and Bookmarks entries.

## To Start Teletext

You can browse Teletext in the main video window or open new Teletext windows. To do the former, choose View Teletext from the main menu, Teletext from the context menu, or click on the Teletext button in the toolbar.

Only a subset of the Teletext toolbar buttons and context menu items appears in this mode, along with video related items. It is not yet possible to browse Teletext in fullscreen mode.

To leave the Teletext mode, choose one of the video display modes (fullscreen, capture or overlay mode) or click on the Video button in the toolbar.

## To Open a New Teletext Window

In the video window, choose View New Teletext View from the main menu.

In a Teletext window, choose File New Window from the main menu, New Window from the context menu, or click on the New button in the toolbar.

## To Open a Teletext Page

Type the page number on the keyboard. You can also press the cursor keys or click on the small arrow buttons in the toolbar to go to the next or previous page or subpage.

You can click on a page number in the page. With the first (left) mouse button the page opens in the same window, with the third (middle) button in a new window. When the page has subpages it often contains a subpage number like 2/5 (meaning this is subpage 2 of 5). As with page numbers you can click on this number to go to the next subpage. Two right angle brackets >%gt; on a page also link to the next subpage.

If Zapzilla can identify web links or e-mail addresses you can click on them to open your web browser or e-mail application.

## Rotating Subpages

When you open a page it will automatically rotate through its subpages, if it has any. This can be disabled by clicking on the page number in the toolbar.

## Links in the last row

Some TV stations provide a basic navigation system called TOP or FLOF. Here the last row of the page shows links to important pages or sections. You can click on these links to browse the Teletext. A complete TOP index is available under the Go menu.

## Bookmarks

When you choose Bookmarks Add Bookmark from the main or context menu the current page will be added to the Bookmarks menu. When you choose a bookmark Zapzilla will change to the respective channel and open the page. You can remove or edit the bookmarks by choosing Bookmarks Edit Bookmarks .

Some TV stations provide additional information, for example links to a program schedule page or subtitle pages. Similar to bookmarks these pages are listed in the context menu, subtitle pages in the Subtitles submenu.

## History

By clicking on the Back and Forward buttons in the toolbar, or by choosing from the Go menu you can browse through previously visited pages. The Index button brings you back to the main page, usually page 100.

## Concealed Text

Teletext pages can contain concealed text, typically to hide quiz answers. You can see this text after clicking on the Reveal button in the toolbar.

## Character Encoding

TV stations do not always transmit correct character set codes. By choosing from View Encoding you can override the default character encoding.

## Multi-Channel Page Memory

The Zapzilla page memory can contain pages of more than one station. To switch between stations choose from the Channels menu. Note when the memory limit is reached, older pages are removed from page memory. You can change the limit in the Teletext preferences, by choosing Edit Preferences . When you choose the Received channel, Zapzilla shows only pages of the currently received channel and updates the display on channel changes.

## Exporting Pages

Zapzilla supports the X Window clipboard. To mark a section of text, click on the page with the left mouse button and drag the mouse while pressing the button. When you press the Shift key at the same time you can mark a rectangular section of text. There is no cut or copy menu, to paste the text simply move the mouse pointer into another application window and press the third (middle) mouse button.

You can save a Teletext page in various formats by choosing File Save As from the main menu, or Save As from the context menu.

### Zapzilla Save As Dialog

Save As dialog. Contains filename entry, format menu and format options.

You can enter a filename for the page and choose a file format. Options will appear depending on the chosen format:

Graphics char

- Text based formats cannot represent graphics characters in Teletext pages. Here you can enter a replacement.

Color (CSS)

- This is a HTML option. When enabled, page colors will be encoded as Cascading Style Sheets markup.

HTML header

- This is another HTML option. When disabled the HTML header will be omitted, which is useful to integrate several pages in one HTML file.

Correct aspect ratio

- This is a graphical format option. When enabled the image will be scaled to the correct aspect ratio.

Control codes

- This is a text format option. You can choose if terminal control codes shall be inserted to preserve colors and some text styles. If the page uses more than the eight primary colors the actual color will be approximated.

## Search the page memory

You can search for text in the page memory by choosing Edit Search from the main menu, Search from the context menu, or by clicking on the Find button in the toolbar.

### Zapzilla Search Dialog

Search dialog. Contains text entry, regular expression and case insensitive option, cancel, forward and back button.

Enter a text and click on the Forward button to find the next occurence of the text. Accordingly Back will find the previous occurence. When the text has been found, the Zapzilla window will show the page with the search text highlighted.

### Regular Expressions

Regular expressions are a powerful way to search certain patterns in a text. Apart of simply giving the text you want to find, you can build a set of rules to be matched, allowing for much more complex search patterns.

Unicode is a way of encoding characters that aims to support all possible character sets in the world. Using Unicode we can assign a unique code to every character, disregarding whether it is Latin, Greek, Cyrillic, Hebrew or Arabic. Zapzilla uses a Unicode flavour called UCS-2, representing each character as a 16 bit number.

Regular expressions have a syntax in which a few characters are special constructs and the rest are "ordinary". An ordinary character is a simple regular expression which matches that same character and nothing else. The special characters are `$`, `^`, `.`, `*`, `+`, `?`, `[`, `]` and `\`. Any other character appearing in a regular expression is ordinary, unless a `\` precedes it.

For example, `f` is not a special character, so it is ordinary, and therefore `f` is a regular expression that matches the string "f" and no other string. (It does not match the string "ff".) Likewise, `o` is a regular expression that matches only "o". When searching case insensitive these regular expressions also match "F" and "O", but we consider this a generalization of "the same string," rather than an exception.

Any two regular expressions A and B can be concatenated. The result is a regular expression which matches a string if A matches some amount of the beginning of that string and B matches the rest of the string.

As a simple example, we can concatenate the regular expressions `f` and `o` to get the regular expression `fo`, which matches only the string "fo". Still trivial. To do something nontrivial, you need to use one of the special characters. Here is a list of them:

`.` (Period)

- is a special character that matches any single character except a newline, that is an invisible character marking the end of the line. Using concatenation, we can make regular expressions like `a.b`, which matches any three-character string that begins with "a" and ends with "b".

`*`

- is not a construct by itself; it is a postfix operator that means to match the preceding regular expression repetitively as many times as possible. Thus, `o*` matches any number of "o"s (including no "o"s).

  `*` always applies to the smallest possible preceding expression. Thus, `fo*` has a repeating `o`, not a repeating `fo`. It matches "f", "fo", "foo", and so on.

  The matcher processes a `*` construct by matching, immediately, as many repetitions as can be found. Then it continues with the rest of the pattern. If that fails, backtracking occurs, discarding some of the matches of the `*`-modified construct in case that makes it possible to match the rest of the pattern. For example, in matching `ca*ar` against the string "caaar", the `a*` first tries to match all three "a"s; but the rest of the pattern is `ar` and there is only "r" left to match, so this try fails. The next alternative is for `a*` to match only two "a"s. With this choice, the rest of the regular expression matches successfully.

`+`

- is a postfix operator, similar to `*` except that it must match the preceding expression at least once. So, for example, `ca+r` matches the strings "car" and "caaaar" but not the string "cr", whereas `ca*r` matches all three strings.

`?`

- is a postfix operator, similar to `*` except that it can match the preceding expression either once or not at all. For example, `ca?r` matches "car" or "cr"; nothing else.

`[ ... ]`

- is a "character set", which begins with `[` and is terminated by `]`. In the simplest case, the characters between the two brackets are what this set can match.

  Thus, `[ad]` matches either one "a" or one "d", and `[ad]*` matches any string composed of just "a"s and "d"s (including the empty string), from which it follows that `c[ad]*r` matches "cr", "car", "cdr", "caddaar", etc.

  You can also include character ranges in a character set, by writing the starting and ending characters with a `-` between them. Thus, `[a-z]` matches any lower-case ASCII letter. Ranges may be intermixed freely with individual characters, as in `[a-z$%.]`, which matches any lower-case ASCII letter or "$", "%" or period.

  Note that the usual regexp special characters are not special inside a character set. A completely different set of special characters exists inside character sets: `]`, `-` and `^`.

  To include a `]` in a character set, you must make it the first character. For example, `[]a]` matches "]" or "a". To include a `-`, write `-` as the first or last character of the set, or put it after a range. Thus, `[]-]` matches both "]" and "-".

  To include `^` in a set, put it anywhere but at the beginning of the set.

  When you use a range in case-insensitive search, you should write both ends of the range in upper case, or both in lower case, or both should be non-letters.

`[^ ... ]`

- `[^` begins a "complemented character set", which matches any character except the ones specified. Thus, `[^a-z0-9A-Z]` matches all characters except letters and digits. `^` is not special in a character set unless it is the first character. The character following the `^` is treated as if it were first (in other words, `-` and `]` are not special there).

`^`

- is a special character that matches the empty string, but only at the beginning of a row. Otherwise it fails to match anything. Thus, `^foo` matches a "foo" that occurs at the beginning of a row.

`$`

- is similar to `^` but matches only at the end of a row. Thus, `x+$` matches a string of one "x" or more at the end of a line.

`\`

- has two functions: it quotes the special characters (including `\` itself), and it introduces additional special constructs.

  Because `\` quotes special characters, `\$` is a regular expression that matches only "$", and "\[" is a regular expression that matches only "[", and so on.

  `\x`, `\X`, `\u` or `\U` followed by a hexadecimal number of up to 4 digits will match Unicode characters. `\x00C9` for example matches "É"

`#url#` and `#email#`

- are specific to Zapzilla. These regular expressions match any web or e-mail address, respectively.

You can find a more comprehensive introduction to regular expressions in the regex manual page.