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

Discussion in 'C Programming' started by zoltan, Mar 13, 2006.

  1. zoltan

    zoltan Guest

    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.
     
    zoltan, Mar 13, 2006
    #1
    1. Advertising

  2. Re: Help wih regexec() function in libc.a library ( Solarisplatform)

    "zoltan" <> writes:
    > 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.)

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Mar 13, 2006
    #2
    1. Advertising

  3. zoltan

    zoltan Guest

    Keith Thompson wrote:
    > "zoltan" <> writes:
    > > 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.)
    >
    > --
    > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > We must do something. This is something. Therefore, we must do this.


    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.
     
    zoltan, Mar 13, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gregory Toomey

    Posix regexec - matching subexpression

    Gregory Toomey, Feb 13, 2005, in forum: C Programming
    Replies:
    6
    Views:
    640
    Richard Bos
    Feb 23, 2005
  2. facing problem while using regexec

    , Dec 7, 2007, in forum: C Programming
    Replies:
    2
    Views:
    549
    Ben Bacarisse
    Dec 7, 2007
  3. Replies:
    3
    Views:
    963
    Mark Bluemel
    Feb 4, 2008
  4. Master Web Surfer

    Need help wih tr/// operator

    Master Web Surfer, Nov 19, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    121
    A. Sinan Unur
    Nov 19, 2003
  5. Skip Montanaro

    Re: Ctypes can't find libc on Solaris

    Skip Montanaro, Jan 27, 2013, in forum: Python
    Replies:
    0
    Views:
    122
    Skip Montanaro
    Jan 27, 2013
Loading...

Share This Page