I apologize for vagueness. I'm asking to anyone knows how to use
henry spencer's regex library.
Well, sure, but again... What on earth are you using that doesn't have
one already?
I expected to send RE pattern
and target string to the library, then it send me back with either
match was found of not, if found send me back position in the
target string and length of matched string.
That is indeed what it does.
but when I saw
the only file with main(); try.c, quickly I got confused.
This is not specific.
I got lost and don't even know how to use the henry spencer's
lib functions(even though I have copy of it). that's why I called
for help. Just getting a small clue wouldbe make this question
wealthy. thank you
Okay, here's the clue:
http://www.catb.org/~esr/faqs/smart-questions.html
Read that. Think about it. Then try to ask a smart question.
Here's some food for thought:
* Why don't you start by reading the documentation?
* If you have access to any sort of Unix-like system, consider reading the
docs for the regular expression library the system *already has*.
* In fact, if Windows systems don't have one too, that would sort of surprise
me, this is very basic functionality.
* What you may be missing is that taking a regular expression string and
converting it into something that can be quickly and efficiently processed
is computationally expensive...
* ... and most programs which use a regular expression use it more than once.
* Because of this, regex libraries typically separate out the "compilation"
of a regex from a string into an internal data structure, and the use of
that data structure to match stuff.
But seriously, this question is really too vague to do anything with. You
don't give us any clue what you want to do, what you've tried, or whether
you even know what "documentation" is, let alone whether you've read it.
Saying that you are confused by reading example code suggests that you haven't
yet looked at documentation.
Try using regcomp, regexec, and then regfree, in that order. If that's
not enough of a clue, you really are going to have to learn to ask better
questions.
-s