J. Berman
J. Berman

Reputation: 534

Regex for this string

The buffer string char *bufferString points to the first element of the following string:

BER Berman, Jane 06/29/91 Photography;Dance;Music\n

I'd like to parse each item of the topics last list of topics only and store them

What I've tried:

#define REGEX_TOPIC "^[a-zA-Z].*^[0-9/0-90-9/0-90-9+]"
char *topic;
topic = strstr(bufferString, REGEX_TOPIC);

Could you help me here?

Upvotes: 0

Views: 137

Answers (1)

johnsyweb
johnsyweb

Reputation: 141780

The strstr() function locates the first occurrence of the null-terminated string s2 in the null-terminated string s1. It does not handle regular expressions.

For using regular expressions in C, see the answers to Regular expressions in C: examples?.

Upvotes: 6

Related Questions