do strcmp support wildcard strings

R

Raman

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
 
T

Torsten Karwoth

Raman said:
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
 
M

Mark Bluemel

Raman said:
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.
 
M

Malcolm McLean

Mark Bluemel said:
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.
 
M

Mark Bluemel

Malcolm said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top