Regarding regular expressions in Solaris

Discussion in 'C Programming' started by sunil, Dec 13, 2007.

  1. sunil

    sunil Guest

    Hi,

    Am writing one C program for one of my module and facing one problem
    with the regular expression functions provided by the library libgen.h
    in solaris.

    In this library we are having two functions to deal with
    the regular expressions

    char *regcmp(const char *string1, /* char *string2 */ ,
    int /*(char*)0*/); ------this function is to compile the regular
    expression.In case of failure it will return NULL.

    char *regex(const char *re, const char *subject, /*
    char *ret0 */ ...);---------This function is used to execute the
    compiled expression against the subject string.


    Problem

    Compiled and executed the following regular expression
    using the above two function like below.

    char *name = regcmp("[A-Z]*",(char*)0);
    const char *newcursor = regex(name,"ps");

    In the above case written the regular expression only to check
    whether the given value is capitals or not. To check this one I
    submitted the value "ps" in lower case. Still the regular expression
    is executing succefully wit out failure.In the above case it shold
    have to fail but still it is successful. The regex function is not
    returning NULL in this case.

    If anybody knows abot this please let me know.


    Regards
    Sunil.
    sunil, Dec 13, 2007
    #1
    1. Advertising

  2. sunil

    Ian Collins Guest

    sunil wrote:
    > Hi,
    >

    Please don't multi-post on Usenet, the other group you posted to is more
    appropriate.

    --
    Ian Collins.
    Ian Collins, Dec 13, 2007
    #2
    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. Jay Douglas

    Custom Regular Expressions in ASP.net

    Jay Douglas, Nov 2, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    598
    mikeb
    Nov 3, 2003
  2. mark

    Regular expressions

    mark, Jun 30, 2003, in forum: Perl
    Replies:
    4
    Views:
    1,713
  3. Dustin D.
    Replies:
    1
    Views:
    11,144
  4. Jay Douglas
    Replies:
    0
    Views:
    592
    Jay Douglas
    Aug 15, 2003
  5. Noman Shapiro
    Replies:
    0
    Views:
    219
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page