Using the Regular Expresion Editor
This chapter will tell you about how the regular expression editor works.

The organization of the screen
The most important part of the editor is of course the editing area, this is the area where you draw your regular expression. This area is the larger gray one in the middle.
Above the editing area you have two tool-bars, the first one contains the editing actions - much like drawing tools in a drawing program. The second tool bar contains the whats this button, and buttons for undo and redo.
Below the editing area you find the regular expression currently build, in the so called ascii syntax. The ascii syntax is updated while you edit the regular expression in the graphical editor. If you rather want to update the ascii syntax then please do, the graphical editor is updated on the fly to reflect your changes.
Finally to the left of the editor area you will find a number of pre-build regular expressions. They serve two purposes: (1) When you load the editor with a regular expression then this regular expression is made nicer or more comprehensive by replacing common regular expressions. In the screen dump above, you can see how the ascii syntex ".*" have been replaced with a box saying "anything". (2) When you insert regular expression you may find building blocks for your own regular expression from the set of pre build regular expressions. See the section on user defined regular expressions to learn how to save your own regular expressions.

Editing Tools
The text in this section expects that you have read the chapter on what a regular expression is, or have previous knowledge on this subject.
All the editing tools are located in the tool bar above editing area. Each of them will be described in the following.

Selection Tool
The selection tool is used to mark elements for cut-and-paste and drag-and-drop. This is very similar to a selection tool in any drawing program.

Text Tool
Using this tool you will insert normal text to match. The text is matched literally, i.e. you do not have to worry about escaping of special characters. In the example above the following regular expression will be build: abc\*\\\)

Character Tool
Using this tool you insert character ranges. Examples includes what in ASCII text says [0-9], [^a-zA-Z,_]. When inserting an item with this tool a dialog will apear, in which you specify the character ranges.
See description of repeated regular expressions.

Any Character Tool
This is the regular expression "dot" (.). It matches any single character.

Repeat Tool
This is the repeated elements. This includes what in ASCII syntax is represented using an asterix (*), a plus (+), a question mark (?), and ranges ({3,5}). When you insert an item using this tool, a dialog will appear asking for the number of times to repeat.
You specify what to repeat by drawing the repeated content inside the box which this tool inserts.
Repeated elements can both be build outside in and inside out. That is you can first draw what to be repeated, select it and use the repeat tool to repeat it. Alternatively you can first insert the repeat element, and draw what to be repeated inside it.
See description on the repeated regular expressions.

Alternative Tool
This is the alternative regular expression (|). You specify the alternatives by drawing each alternative on top of each other inside the box that this tool inserts.
See description on alternative regular expressions

Compound Tool
The compound tool does not represent any regular expressions. It is used to group other sub parts together in a box, which easily can be collapsed to only its title. This can be seen in the right part of the screen dump above.

Line Start/End Tools   
The line start and line end tools matches the start of the line, and the end of the line respectively. The regular expression in the screen dump above thus matches lines only matches spaces.
See description of position regular expressions.

Word (Non)Boundary Tools   
The boundary tools matches a word boundary respectively a non-word boundary. The regular expression in the screen dump thus matches any words starting with the. The word the itself is, however, not matched.
See description of boundary regular expressions.

Positive/Negative Lookahead Tools   
The look ahead tools either specify a positive or negative regular expression to match. The match is, however, not part of the total match.
Note: You are only allowed to place look ahead's at the end of the regular expressions. The Regular Expression Editor widget does not enforce this.
See description of look ahead regular expressions.

User Defined Regular Expressions
To the left of the editing area is a list box located containing user defined regular expressions. Some regular expressions are pre installed with your KDE installation, while other you can save yourself.
These regular expression serves two purposes ( see detailed description), namely (1) to offer you a set of building block and (2) to make common regular expressions prettier.
You can save your own regular expressions by right clicking the mouse button in the editing area, and choosing Save Regular Expression.
If the regular expression you save is within a compound container then the regular expression will take part in making subsequent regular expressions pretier.
User defined regular expression can be deleted or renamed by pressing the right mouse button on top of the regular expression in question in the list box.