468,469 Members | 1,618 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,469 developers. It's quick & easy.

Regarding regular expressions in Solaris

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.

Dec 13 '07 #1
1 1850
sunil wrote:
Hi,
Please don't multi-post on Usenet, the other group you posted to is more
appropriate.

--
Ian Collins.
Dec 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Michael McGarry | last post: by
2 posts views Thread by Sehboo | last post: by
7 posts views Thread by Billa | last post: by
3 posts views Thread by a | last post: by
13 posts views Thread by Wiseman | last post: by
12 posts views Thread by FAQEditor | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.