CBFalconer <cb********@yahoo.comwrites:
Knight wrote:
>in the following program, compiled using gcc on Linux, and
invoked as
a.out '[a-z]*' '111'
I get '111' matches '[a-z]*'. What am I doing wrong?
#include <stdio.h>
#include <stdlib.h>
>#include <sys/types.h>
#include <regex.h>
You are including the above include files, which don't exist in
standard C.
No, that's not what he's doing wrong. There is nothing wrong with
using headers that are not defined by the C standard, as long as
you're aware that your code won't be portable to all C
implementations. Not all C programs can be, or should be, 100%
portable.
What he's doing wrong is posting this question to comp.lang.c (which
deals with standard C) rather than to comp.unix.programmer (which
deals with the system that defines the <sys/types.hand <regex.h>
headers). That's a minor offense (I hesitate even to use the word
"offense"), which is easily corrected by telling the OP where to post.
I believe that was already done several days ago.
Chuck, I understand that you download news articles in batches.
That's fine, but if you could post your responses as soon as possible
after downloading the articles, you could avoid a lot of situations
like this one where you post responses to questions that have already
been answered.
--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"