One of the reasons to use XML in the first place is to provide structure that allows you to find your data. Having said that, perhaps using R-E's is part of your assignment. In that case, you would use the functions declared in regex.h
. For the full explanation of regex usage in C,
A previous thread on the subject
may be illustrative.
The basic premise is that your code contains a literal (or other, I guess) string containing a regular expression notation. This string is then 'compiled' and the resulting handle is used to reference the compiled regex in one or more searches of a specified buffer.
Now, there is another alternative which I think is loads more fun and instructive, and that is to write a simple lexical analyzer using lex
. This generates C code, which you compile, link, & run against your XML file(s).