Regexp(3I)
β¨ NAME β¨
okay bestie, welcome to Regexp β the InterViews Reference Manual girlie whose whole job is regular expression searching π
β¨ (yes the page header says Regexp(3I) and the manual is the InterViews Reference Manual, we're fancy like that π)
π¦ SYNOPSIS π¦
#include <InterViews/regexp.h>
πΈ DESCRIPTION πΈ
So a Regexp is literally a little glow-up container for a regular expression pattern π and it comes with operations for searching and matching that pattern against a string. No cap.
The syntax of the regular expression pattern? It's exactly the same as the syntax for ed(1). Periodt. π
And the tea is: you can get information about the most recent match of the regular expression β and about its sub-expressions too π«Ά iconic behaviour honestly.
π PUBLIC OPERATIONS π
π Constructors π
Regexp(const char* pattern)Regexp(const char* pattern, int length)
These two construct a brand-new Regexp for pattern. Slay. β¨
π Matching & Searching π
int Match(const char* text, int length, int index)β this one attempts a match against text (which is of length length, obvs) at position index. The return value is the length of the matching string, or a negative number if the match failed π fr.int Search(const char* text, int length, int index, int range)β this one searches for a match in the string text (of length length, again). Matches are attempted starting at positions between index and index plus range. Here's the vibe check:- if range is positive, the first match after index is reported β
- if range is negative, the first match before index is reported π«
The return value is the index of the starting position of the match, or a negative number if there's no match in the specified range π
π§ Match Info Girlies π§
int BeginningOfMatch(int subexp)int EndOfMatch(int subexp)
These return information about the most recent match π. If subexp is zero (which is the default, bestie), info is reported for the complete regular expression. Any other value of subexp refers to sub-expressions in the pattern π«Ά. For example, if subexp is 2, information is returned for the sub-expression specified by the second pair of \( and \) delimiters in the pattern. iykyk π
π SEE ALSO π
and that's the whole page, bestie!! π this iconic lil manual page came from InterViews, dated 23 May 1989, and its header/footer name is Regexp(3I) β yes she's been serving regex realness since '89 and she still ate ππ
β¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms