By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

do strcmp support wildcard strings

P: n/a
Hi All,
Could any one give any clue about the strcmp function for any supportr
of wildcards.

or any other standard C Library function ?

Regards,
Raman Chalotra

Aug 14 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Raman wrote:
Hi All,
Could any one give any clue about the strcmp function for any supportr
of wildcards.
see the irc bot energymech on www.energymech.net. In the source package
for emech-3.0.2 in src/function.c there is a function 'matches' which does
this kind of match. Oder ircbots/irc-servers may have such a function too.

HTH
Torsten

Aug 14 '07 #2

P: n/a
Raman wrote:
Hi All,
Could any one give any clue about the strcmp function for any supportr
of wildcards.

or any other standard C Library function ?
No standard way in the language, but the normal approach would be to use
a regular expression library I think. Some platforms, e.g. POSIX, have
standardised (standardised for the platform, not for the C language)
support, but if in doubt I guess GNU regex would be what I'd look at.
Aug 14 '07 #3

P: n/a
"Mark Bluemel" <ma**********@pobox.comwrote in message
news:f9**********@aioe.org...
No standard way in the language, but the normal approach would be to use a
regular expression library I think. Some platforms, e.g. POSIX, have >
standardised (standardised for the platform, not for the C language)
support, but if in doubt I guess GNU regex would be what I'd look at.
Wuildcard matching, or globbing, is much simpler than regular expression
parsing.
Unfortunately my wildcard matcher has gone walkies. However it was only
about a screenful of code.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Aug 14 '07 #4

P: n/a
Malcolm McLean wrote:
"Mark Bluemel" <ma**********@pobox.comwrote in message
news:f9**********@aioe.org...
>No standard way in the language, but the normal approach would be to
use a regular expression library I think. Some platforms, e.g. POSIX,
have standardised (standardised for the platform, not for the C
language) support, but if in doubt I guess GNU regex would be what I'd
look at.
Wuildcard matching, or globbing, is much simpler than regular expression
parsing.
Assuming that is actually what the original poster wanted. Globbing is
specifically about expanding wildcards to lists of filenames. Naturally,
you can, and people do, apply the same sorts of pattern matching to
string usage.

However if, as I assumed, the original poster wanted to do general
purpose pattern matching in strings, regular expressions are a known,
proven technology. As far as simplicity is concerned, at least in terms
of implementation simplicity it hardly matters, as there are plenty of
freely available implementations around.
Aug 15 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.