473,396 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Aug 14 '07 #1
4 8092
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lian | last post by:
Hi all, I am confused by the rule of comparing two unicode string using function "strcmp". For exmaple, using "strcmp" to compare two Chinese uincode string, depending on what rule can "PHP"...
5
by: Markus Ernst | last post by:
Hi I noticed in some examples to the encrypt functions of the PHP manual a syntax was used for password checks such as if (strcmp($userpassword, md5($_POST)) == 0) { // do login } What is...
6
by: muser | last post by:
The following error appears: 'strcmp' : cannot convert parameter 1 from 'char' to 'const char *'. I've already tried using single quotations. the header file only contains the struct contents....
3
by: jl_post | last post by:
Hi, I recently wrote two benchmark programs that compared if two strings were equal: one was a C program that used C char arrays with strcmp(), and the other was a C++ program that used...
53
by: Allan Bruce | last post by:
Hi there, I am reading a file into a char array, and I want to find if a string exists in a given line. I cant use strcmp since the line ends with '\n' and not '\0'. Is there a similar function...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
36
by: Chuck Faranda | last post by:
I'm trying to debug my first C program (firmware for PIC MCU). The problem is getting serial data back from my device. My get commands have to be sent twice for the PIC to respond properly with...
47
by: fishpond | last post by:
One way I've seen strcmp(char *s1, char *s2) implemented is: return immediately if s1==s2 (equality of pointers); otherwise do the usual thing of searching through the memory at s1 and s2. Of...
1
by: mosullivan | last post by:
I had to write a program that would accept 7 strings through scanf, list the strings, alphabetize, and relist. I was supposed to use strcmp to assist with the sort and write it so that it can sort...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.