check-regexp(1)

check-regexp1

Test regular expressions from the command line

Usage

check-regexp 'regular expression' 'string1' 'string2' ...

Overview

check-regexp (GNU Source-highlight)

You simply pass as the first command line argument the regular expression and then the strings you want to try to match.
It is crucial, in order to avoid shell substitutions, to enclose both the expression and the strings in single quotes.

The program then prints some information about the possibly successful matching.
In the output the what[0] part represents the whole match, and the what[i] part represents the i-th marked subexpression that matched.

The program also prints possible prefix and suffix.

Options

This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below.

-h, --help

Print help and exit

-V, --version

Print version and exit

Releases

Unchanged in 9 releases since Debian 6.0 (Squeeze).

  1. 6.0–Arch

Author

check-regexp was written by Lorenzo Bettini <www.lorenzobettini.it>. This man page was written by Cesare Tirabassi <[email protected]>.

From source-highlight 3.1.9-19 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.