do strcmp support wildcard strings

Discussion in 'C Programming' started by Raman, Aug 14, 2007.

  1. Raman

    Raman Guest

    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
     
    Raman, Aug 14, 2007
    #1
    1. Advertising

  2. 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
     
    Torsten Karwoth, Aug 14, 2007
    #2
    1. Advertising

  3. Raman

    Mark Bluemel Guest

    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.
     
    Mark Bluemel, Aug 14, 2007
    #3
  4. "Mark Bluemel" <> wrote in message
    news:f9rq2h$coh$...
    > 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
     
    Malcolm McLean, Aug 14, 2007
    #4
  5. Raman

    Mark Bluemel Guest

    Malcolm McLean wrote:
    > "Mark Bluemel" <> wrote in message
    > news:f9rq2h$coh$...
    >> 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.
     
    Mark Bluemel, Aug 15, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shane Peck

    strcmp problem

    Shane Peck, Sep 19, 2003, in forum: C++
    Replies:
    6
    Views:
    2,361
    Kevin Goodsell
    Sep 22, 2003
  2. Steven
    Replies:
    9
    Views:
    411
    Keith Thompson
    Dec 29, 2005
  3. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    772
    Malcolm
    Jun 24, 2006
  4. Steve555
    Replies:
    8
    Views:
    3,372
    MisterE
    Jan 8, 2009
  5. Replies:
    7
    Views:
    844
Loading...

Share This Page