Making Binary Regular Expression

When you use binary regular expressions for a delimiter or a format of a packet of a custom format, you can edit them with the dedicated user interfaces show below.

They are also used to make plain binaries in, for example, transmitting buttons in Profile Configurations. In this case, only fixed byte atoms can be used.

About Binary Regular Expression

The specialized regular expressions named the “Binary Regular Expressions” used in VisualLogger are simpler than ordinary regular expressions.

They can contain literals and operators below.

  • 0x00 – 0xff : Single byte atom. Matches a specified single byte.
  • “.” : One byte wildcard. Matches any single byte.
  • “*” : Kleene star. Matches zero or more repetitions of a preceding element.
  • “[” and “]” : Bracket expression. Set of single byte atoms. Matches a single byte that is contained within the brackets.
  • “[^” and “]” : Complement of a set of single byte atoms. Matches a single byte that is not contained within the brackets.
  • “(” and “)” : Grouping expression. Elements matched within the parentheses are treated as one element. Such elements can be used as an operand of a Kleene star so that repetitions of multiple bytes can be matched. But in this app, it is usually used as a mark of the portion to be extracted.
  • “-” : Used in bracket expressions. Matches the range of bytes. This literal is inserted between the start byte and the end byte, like this: [0x30-0x39] (ASCII numerical characters)

Restrictions on Binary Regular Expression

There are several operators which cannot be used in the Binary Regular Expressions, including “|” (Union of elements), “{}” (Specified number of repetitions), etc.
However, of course, they can be used in UTF-8 regular expressions.

How To Edit Binary Regular Expression

Dedicated User Interfaces for Editing Binary Regular Expression
v09-binary_re_parts-small.png

AC stands for “All Clear”. BS stands for “Back Space”. (Delete one left literal.)

Moving Cursor

You can directly set the cursor position by touching the desired position.
You can also use the slider or the ◀ ▶ keys.

The undisplayed portion of the expression can be made to appear by sliding the expression itself.

Entering Single Byte

A single byte consists of two hexadecimal digits. Using the dedicated keys, you can reliably enter the byte element.

When you touch one of the hexadecimal keys (0-9, a-f), a half of the byte (nibble) is entered into the “Byte Key” (the biggest key). Nibbles are entered from right to left on the “Byte Key”. Nibbles that were carried over go away.

After the byte you desired is entered in the “Byte Key”, insert it into the byte sequence by touching the “Byte Key” itself. While a byte is in the “Byte Key”, you can also vary the byte value with the slider or the ▼▲ keys, as well as with the nibble keys.

Extracting Portion of Packet

“()” (Grouping operator) is used to specify a portion of a packet.
In the case of entering a delimiter of a packet, “()” is disabled.

Matched elements within parentheses will be regarded as data which has a primitive format you specified.
Although you can make multiple groups, only the first group will be numerized. Multiple extraction will be supported in a future version.

Notice

Even if the entered expression has syntax errors, you can finish entering and even you can specify it in a Profile Configuration.
But if you do so, the errors in the expression are inherited to the Profile Configuration.
Therefore, you cannot use such a regular expression when you communicate with the data source.