Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   do strcmp support wildcard strings (http://www.velocityreviews.com/forums/t529058-do-strcmp-support-wildcard-strings.html)

Raman 08-14-2007 07:54 AM

do strcmp support wildcard strings
 
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


Torsten Karwoth 08-14-2007 08:27 AM

Re: do strcmp support wildcard strings
 
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


Mark Bluemel 08-14-2007 08:45 AM

Re: do strcmp support wildcard strings
 
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.

Malcolm McLean 08-14-2007 08:40 PM

Re: do strcmp support wildcard strings
 
"Mark Bluemel" <mark_bluemel@pobox.com> wrote in message
news:f9rq2h$coh$1@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


Mark Bluemel 08-15-2007 07:36 AM

Re: do strcmp support wildcard strings
 
Malcolm McLean wrote:
> "Mark Bluemel" <mark_bluemel@pobox.com> wrote in message
> news:f9rq2h$coh$1@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.


All times are GMT. The time now is 07:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.