1825576 Members
2148 Online
109682 Solutions
New Discussion

Standard C question

 
SOLVED
Go to solution
Dave Johnson_1
Super Advisor

Standard C question

Assuming the standard C compiler shipped with 11.00, the function strstr(s1, s2) returns a point to the first occurance of s2 in s1.

I left my K&R at home today and the man page does not give any more detail.

Does this use regular express matching or is exact char matching? Can I pass s2=".pk[bghs]$" to find the 4 possible patterns anchored at the end of the line?

Thanks
-Dave
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Standard C question

No, strstr (or any of the string(3c)) functions do not do regular expression evaluation; however, regex() will do what you need. Man regex for details.
If it ain't broke, I can fix that.
curt larson_1
Honored Contributor

Re: Standard C question

Does this use regular express matching? nope