|
You can do this, and much, much more, with regular expressions. The ILE C library has functions called "regcomp", "regexec", "regfree" for doing this sort of thing. I posted a sample a while back, you can find it in the archives here: http://archive.midrange.com/rpg400-l/200105/msg00106.html On Fri, 4 Oct 2002, Richard B Baird wrote: > hey all, > > i've searched the archives to no avail, and started to write this myself, > but i'm struggling and it's starting to get out of hand... does anyone > have something similar to this in their toolbox, or know of an existing api > or c routine to do this? > > i need an elegant way of comparing one string that could have a wild card > or two, to another string. > > for instance the first string could have: > 1. *Monthly or > 2. Monthly* or > 3. *Monthly* > > and compared to the following fields: > > a. Bi-Monthly > b. Bi-Monthly 1st Quarter > c. Monthly Reports > > compares would result in: > > 1. would match a. only > 2. would match c. only > 3. would match a, b and c. > > btw, if you haven't done it already, don't write it for me.... > > tia, > > rick >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.