Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > do strcmp support wildcard strings

Reply
Thread Tools

do strcmp support wildcard strings

 
 
Raman
Guest
Posts: n/a
 
      08-14-2007
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

 
Reply With Quote
 
 
 
 
Torsten Karwoth
Guest
Posts: n/a
 
      08-14-2007
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

 
Reply With Quote
 
 
 
 
Mark Bluemel
Guest
Posts: n/a
 
      08-14-2007
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.
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      08-14-2007
"Mark Bluemel" <(E-Mail Removed)> wrote in message
news:f9rq2h$coh$(E-Mail Removed)...
> 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

 
Reply With Quote
 
Mark Bluemel
Guest
Posts: n/a
 
      08-15-2007
Malcolm McLean wrote:
> "Mark Bluemel" <(E-Mail Removed)> wrote in message
> news:f9rq2h$coh$(E-Mail Removed)...
>> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard String Comparisons: Set Pattern to a Wildcard Source chaoticcranium@gmail.com Python 7 10-05-2010 09:26 PM
How to get strcmp() to work with number strings? Steve555 C Programming 8 01-08-2009 06:31 AM
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
strcmp() question, 4 words, two strings, equal return value. Steven C Programming 9 12-29-2005 11:44 PM
strcmp problem Shane Peck C++ 6 09-22-2003 05:44 PM



Advertisments