RegexStudio Documentation

The premier Regular Expression development environment for .Net

The Expression Builder

The Expression Builder makes it much easier to remember what regular expressions are expressed for various constructs. It will not write your regular expressions for you, but it will save you the luxury of having to remember that an anchor for start of string is expressed as \A whereas a start of line is expressed with the ^ character.

In order to use the Expression Builder, the regex field must have the focus, and the caret must be located at the appropriate location within your regular expression text. Most of the time, this will be at the end of the regular expression, as you build up your regular expression from various fragments.

You can use the Expression Builder from both the Create tab, (via the button as well as the Tools menu item) as you would expect, as well as from the Test tab (there is no button, only from the Tools menu). Although, most likely you will mostly use it from the Create tab.
 

The Expression Builder menu:


The Expression Builder provides a user interface layer for entering cryptic regular expressions. The Expression Builder menu, whether you display it from the Tools menu, or by clicking on the Expression Builder button above the regex field has the following main items:


Many of the menu items immediately insert the regular expression fragment into the current cursor location in the regex field. There are many others which display a dialog box, in which you fill out fields with various pieces of information, and when you click the Insert button in the dialog box, the regular expression fragment is inserted into the regex field.

Literal Text

Literal text is simple and can be entered through the Insert Literal Test dialog box, as follows:


ASCII Chart

The Insert ASCII Character dialog box shows an ASCII character chart of buttons. As you move the mouse cursor over the grid, you will see the decimal, octal, and hex values for the various ASCII values appear in the Value section of the dialog. A tooltip also appears which provides an explanation for the characters in the ASCII chart.

The following picture shows the Insert ASCII Chart dialog box:



Several abbreviations are used in the ASCII chart to represent common characters. The following table provides an explanation for these characters.
 

Abbreviation

Value (hex)

Description

NUL

0

Null

SO

1

Start of heading

STX

2

Start of text

ETX

3

End of text

EOT

4

End of transmission

EN

5

Enquiry

AC

6

Acknowledge

BEL

7

Bell

BS

8

Backspace

TAB

9

Tab

LF

A

Linefeed

VT

B

Vertical tab

FF

C

Form feed

CR

D

Carriage return

SO

E

Shift out

SI

F

Shift in

DLE

10

Data link escape

DC1

11

Device control 1

DC2

12

Device control 2

DC3

13

Device control 3

DC4

14

Device control 4

NAK

15

Negative acknowledge

SYN

16

Synchronous acknowledge

ETB

17

End of transmission block

CA

18

Cancel

EM

19

End of medium

SUB

1A

Substitute

ESC

1B

Escape

FS

1C

File separator

GS

1D

Group separator

RS

1E

Record separator

US

1F

Unit separator

SP

20

Space

When you click a button, the read-only Regular Expression Fragment shows the text that will be inserted in the Regular Expression field.  You can choose to express this value in hex (base 16) or octal (base 8).  Click the Insert button to move the move the regular expression fragment into the regular expression field and close the dialog box. 

Inclusion Classes

The Insert Inclusion dialog box allows you to choose the characters which should be included in a regular expression.  Inclusion characters are those which should be included in a regular expression.  You can choose alphabetic, numeric, alphanumeric, keyboard symbols and a custom setting.  If you are choosing an alphabetic option, you can also choose the appropriate case setting.  When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Inclusion Dialog Box appears below:

 

Exclusion Classes

 

The Insert Exclusion dialog box is similar to the Insert Inclusion dialog box, but specifies those characters that you wish to be excluded for a regular expression.  You can choose alphabetic, numeric, alphanumeric, keyboard symbols and a custom setting.  If you are choosing an alphabetic option, you can also choose the appropriate case setting.  When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Exclusion Dialog box appears below:

 

Interval

By choosing the Interval menu and then selection the Interval menu item, the Insert Interval dialog box will be displayed.  The Insert Interval dialog box allows you to choose the options attributed to an interval match.  You can choose an exact match, you can choose at least a certain number of match.  There is also a checkbox for forcing the interval to be lazy. 

When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Interval Dialog appears as follows:

 

Capture Groups

There are three options for inserting capture groups: Capture, Named Capture, and Non-Capture group.  The only information required for a capture group is to enter a substring you would like to capture.  When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Capture Group Dialog appears as follows:

 

Lookaround

The Insert Lookaround dialog box, found on the Grouping menu item followed by the Lookaround option. Allows you to specify information for entering a lookaround.  Theree are two types:  positive, negative.  You can also choose a negative lookbehind.  All the information you need to enter is the substring.  

When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Lookaround Dialog appears as follows:

 

Inline Comments

The Miscellaneous | Insert Comment menu option will display the Insert Comment dialog box.  This simple dialog box takes a single comment string, which is the default field.  When you have chosen your options, the regular expression fragment read only field will show how the fragment will appear.  When you are satisfied with your selection, click on the Insert button.

The Insert Comments Dialog appears as follows: