Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie Question, please help with searching

0 views
Skip to first unread message

Erik Ryerson

unread,
Dec 28, 1998, 3:00:00 AM12/28/98
to
Hi,
This is a very basic problem I'm sure, but one which has been annoying the
hell out of me.
I'm trying to write a simple piece of C code which will pull the remote IP
address out of Sendmail Received: headers.
So all I would need to start is an example of how to, open a specifified
file (with fopen i guess), search it for a regular expression (something
like "%s.%s.%s.%s" (i know that's probably wrong, but the idea is to look
for IP numbers))
and then print the match to the screen, or exit saying "No match."

I do have a Perl version of the above program if that would be helpful to
anyone, but to me, perl makes less sense than C.

Anyway I'd appreciate any help, and say thanks in advance.

E.Ryerson


Paul Lutus

unread,
Dec 28, 1998, 3:00:00 AM12/28/98
to
Why not post your code and ask for help?

Paul Lutus

Erik Ryerson wrote in message <36880...@news.inch.com>...

paolo...@my-dejanews.com

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
In article <36880...@news.inch.com>,

Erik Ryerson <rye...@shell.inch.com> wrote:
> Hi,
> This is a very basic problem I'm sure, but one which has been annoying the
> hell out of me.
> I'm trying to write a simple piece of C code which will pull the remote IP
> address out of Sendmail Received: headers.
> So all I would need to start is an example of how to, open a specifified
> file (with fopen i guess), search it for a regular expression (something
> like "%s.%s.%s.%s" (i know that's probably wrong, but the idea is to look
> for IP numbers))
> and then print the match to the screen, or exit saying "No match."
>
> I do have a Perl version of the above program if that would be helpful to
> anyone, but to me, perl makes less sense than C.
>
> Anyway I'd appreciate any help, and say thanks in advance.
>
> E.Ryerson
>
You can look for regexpr search code in C in: http://www.snippets.org
Ciao Paolo

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

0 new messages