I found What do the numbers in a man page mean? which explains the sections for command/library documentation quite nicely, and I was looking at the output for man regex and noticed the See Also referred to regex(3).

I tried to run man 3 regex, but got the following message:

No manual page for regex in section 3

My question is - where is it?

This is on Ubuntu 10.04 if that makes a difference.



NAME regcomp, regexec, regerror, regfree - POSIX regex functions

Works fine here on Arch Linux and also on the Internet...

You might need to (re)install them:

sudo apt-get install manpages manpages-dev manpages-posix manpages-posix-dev
  • yeah, the section 3 page for regex was not already installed - fixed, thanks
    – HorusKol
    May 6 '11 at 5:10

In Ubuntu this man page belongs to manpages-dev package.


You need to install the manpages-dev package:

$ dpkg -S /usr/share/man/man7/regex.7.gz
manpages: /usr/share/man/man7/regex.7.gz

$ dpkg -S /usr/share/man/man3/regex.3.gz
manpages-dev: /usr/share/man/man3/regex.3.gz

Practically all the man pages in sections 2 and 3 come from the manpages-dev package.

I guess this is because they take up about 20 MB, and some users don't need them.

(There are also some man pages provided by the various *-dev packages and programming language specific packages, e.g. *-perl.)

If ever you can't find a file, but you know part of its name, apt-file can help:

$ apt-file search regex.3.gz
manpages-dev: /usr/share/man/man3/regex.3.gz

On my gentoo system man regex only gives me the section 3 (POSIX syscall) man page. (What manual section did your man regex retrieve it's man page? Just curious.)

Running a equery belongs /usr/include/regex.h on my system reveals that that header file is part of the sys-libs/glibc package. Similarly, by running the command equery belongs /usr/share/man/man3/regex.3.bz3 I found out that the man page for the regex.h file is provided by the package sys-apps/man-pages.

Now, I imagine Gentoo and Ubuntu might have different ways of organizing their manfiles, but I think it is worth a shot for you to check if you got some man-page related package not installed on your host. I take for granted that your machine has Ubuntu's glibc package installed (otherwise I would find it hard to believe that your system even boots up), you should have the file /usr/include/regex.h available on your system (unless Ubuntu has decided to have it elsewhere, like /usr/local/include/regex.h).

  • man regex returns the page from section 7 on my Ubuntu install
    – HorusKol
    May 6 '11 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.