Help wih regexec() function in libc.a library ( Solaris platform)

Z

zoltan

Hi,
I am using a function called regexec() as defined in the regex.h
header in libc.a.
I am coding on Solaris 8 machine. The function is defined as follows :

int regexec(const regex_t * preg, char * string, (size_t)
nmatch,regmatch_t pmatch[],int eflags);

My Query is this :

How do I use the pmatch[] field to display the subexpressions which
match?

For instance, if I want to simply match the string with the regular
expression, I can
define the nmatch field to be 0 and pmatch[] as NULL. However, I
require to obtain
the subexpressions using pmatch[].... Can anyone give some practical
examples?

Thanks and Regards,

Timmy Jose.
 
K

Keith Thompson

zoltan said:
I am using a function called regexec() as defined in the regex.h
header in libc.a. I am coding on Solaris 8 machine. The function is
defined as follows :

int regexec(const regex_t * preg, char * string, (size_t)
nmatch,regmatch_t pmatch[],int eflags);

My Query is this :

How do I use the pmatch[] field to display the subexpressions which
match?
[...]

We don't know. regexec() isn't defined by the C standard. It is
defined by POSIX, so you might try comp.unix.programmer. (But try
"man regexec" first; you might find the answer there.)
 
Z

zoltan

Keith said:
zoltan said:
I am using a function called regexec() as defined in the regex.h
header in libc.a. I am coding on Solaris 8 machine. The function is
defined as follows :

int regexec(const regex_t * preg, char * string, (size_t)
nmatch,regmatch_t pmatch[],int eflags);

My Query is this :

How do I use the pmatch[] field to display the subexpressions which
match?
[...]

We don't know. regexec() isn't defined by the C standard. It is
defined by POSIX, so you might try comp.unix.programmer. (But try
"man regexec" first; you might find the answer there.)

Thanks Keith. I will try that group. I tried "manning" but there was no
specific example for my query and it got more fuzzy!!! ;-)

Regards,

Timmy Jose.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top