0

I have seen How do I look up man page references with square brackets?. The questioner gives the example of gittutorial(7) and being able to access it by man 7 gittutorial.

When I look at man regex, the top line has:

REGEX(7)                   Linux Programmer's Manual                  REGEX(7)

Now this man page is too difficult for me, so when I see:

AUTHOR
       This page was taken from Henry Spencer's regex package.

SEE ALSO
       grep(1), regex(3)

       POSIX.2, section 2.8 (Regular Expression Notation).

I try man 3 regex but that gives me:

[06:46 PM] ~ $ man 3 regex
No manual entry for regex in section 3
[06:46 PM] ~ $ 

What is the correct way to access regex(3)?

man 7 regex works for regex(7), man 4 tty works for tty(4) and man 8 updatedb works for updatedb(8).

2 Answers2

0

"man 3 regex" is the correct command and it works fine for me. Probably, you don't have installed the necessary packages that provide the manpage. Visit this page for more details.

staxyz
  • 101
  • 1
  • Thanks for the U&L link! [I guess this is because they take up about 20 MB, and some users don't need them](http://unix.stackexchange.com/a/12707/15760) makes sense. –  Nov 06 '13 at 13:59
0

The manpage of regex in section 3 in not present on your system.

To find out which package this file contains type use apt-file. You need to install it first and then update the local cache:

user@host:~# apt-get install apt-file
user@host:~# apt-file update

Then search the cache with:

user@host:~# apt-file search /usr/share/man/man3/regex.3.gz
manpages-dev: /usr/share/man/man3/regex.3.gz

So you see which packages you can install: manpages-dev:

user@host:~# apt-get install manpages-dev

After installation man 3 regex should work.

chaos
  • 27,106
  • 12
  • 74
  • 77
  • I do have `/usr/share/man/man3` with quite a few .gz files in there. But `regex.3.gz` isn't there as you point out. I'm not keen on installing it. There are easier reads on `regex` available but now I know why I don't have `regex(3)` :) –  Nov 06 '13 at 13:59
  • Yeah google man 3 regex and you're in, but I thought it's better to know how to get them or find out where they are... =) – chaos Nov 06 '13 at 14:22