Results 1 to 4 of 4
I'm writing a program that needs to be able to match different types of fields.
These fields include date/time, numbers, and strings. I'm just not quite sure of how I ...
- 11-05-2007 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
matching fields
I'm writing a program that needs to be able to match different types of fields.
These fields include date/time, numbers, and strings. I'm just not quite sure of how I want to accomplish this task.
I could fork to grep for string matching, I am not experienced enough to know whether or not this is a good design choice.
Still, I don't know if I'd need to build my own matching system for date/time and numbers. I would think general math and comparison operations would be good for numbers, I don't know what might be good for matching a date/time generically.
Any ideas?
- 11-05-2007 #2
Have you decided yet what programming language you'll use?
- 11-05-2007 #3Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
Well, I'm using C. I understand it would probably be a lot easier in Perl, but I haven't taught myself Perl as of today.
- 11-05-2007 #4
If you're using C, then do this at the command line:
(not regexp).Code:man -a regex
You'll have fun using that regular expression library in your program. Another alternative is:
You could fork() and use grep, but what's the sport in that?Code:man pcre
If you do decide to do it that way, don't call grep and use fork(); call grep by using popen(). It takes care of a lot of the extra processing bookwork for you. (Don't forget that pclose() at the end, to maximize longterm maintainability of your code.)
Hope this helps.


Reply With Quote