Regular Expression Library

Overview

The Regular Expression Library lets you store, organise, and reuse regex patterns with friendly names and group categories. When a dialog accepts a regular expression (such as bookmark creation or text highlighting), you can open this library to pick a pre-built pattern instead of writing one from scratch.

How to use

  1. Open the Regular Expression Library dialog (from a regex-enabled feature, or via Plug-Ins > Utilities > Open Regex Library, Ctrl+Shift+O).
  2. Browse or filter the pattern list using the Search field at the top.
  3. Select a pattern in the list and click OK (or double-click the row) to use it.
  4. Use the Add, Edit, or Remove buttons to manage entries.
  5. Use Load and Save to import or export the library as a CSV file.

List columns

ColumnDescription
Group A category label to organise related patterns (e.g. “Page References”, “Labels”, “Numbers”).
Name A human-readable name describing what the pattern matches.
Pattern The actual regular expression text. Must be a valid C++ std::regex pattern.

Click any column header to sort the list by that column. Clicking the same header again toggles between ascending and descending order.

Editing items

When you click Add or Edit, a small dialog opens with three fields:

FieldDescription
Group A category label to organise related patterns (e.g. “Page References”).
Name A short human-readable label describing what the pattern matches.
Pattern The regular expression text. Must be valid C++ std::regex syntax.

Click OK to save the entry, or Cancel to discard changes.

Toolbar actions

ButtonDescription
Add Opens a dialog to create a new library entry with group, name, and pattern fields.
Edit Opens the selected entry for modification. Enabled only when a row is selected.
Remove Deletes the selected entry after confirmation. Enabled only when a row is selected.
Load Replaces the current library with entries from a CSV file. The expected column order is Group,Name,Pattern. Invalid regex patterns are skipped with a warning.
Save Exports all current entries to a CSV file. If the library was previously loaded from a file, the same path is reused; otherwise a Save dialog appears.

Search and filter

Type one or more keywords into the Search field to filter the list in real time. The filter matches against the Group, Name, and Pattern columns simultaneously. All keywords (space-separated) must match for a row to appear. The search is case-insensitive.

CSV file format

The library CSV uses standard comma-separated format with an optional header row (Group,Name,Pattern). Quoted fields and escaped double-quotes are supported. The file is read and written as UTF-8.

Tip

Double-click any row to immediately select its pattern and close the dialog — this is the fastest way to pick a pattern.

Warning

Patterns that are not valid C++ regular expressions are rejected when loading a CSV. The load operation reports which rows were skipped so you can fix them.

Note

On startup the library attempts to load Docs/regex_library.csv from the application directory. If that file does not exist it falls back to the current working directory.

See also