473,386 Members | 1,791 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,386 software developers and data experts.

Can we do regular expression processing in C ?

Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.

Thanks
Mahendra
Apr 2 '08 #1
6 1698
Mahendra Kutare wrote:
Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.
Not in standard C, there are plenty of extensions (POSIX regex for example).

--
Ian Collins.
Apr 2 '08 #2
In article <65*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
Mahendra Kutare wrote:
Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.
Not in standard C, there are plenty of extensions (POSIX regex for example).
And I betcha that was written in ... wait for it ... C!

Yes, you can indeed do regular expression processing in C. Even in
absolutely 100% standard C.

You can do *DAMN NEAR ANYTHING* in standard C. (Even *THAT*? Get your
mind out of the gutter! I said "damn near"! :) )

You just have to be willing (and able) to write the code to do it if you
don't have (or for some reason don't want to/aren't allowed to use) a
library routine that already does it for you.

Fortunately, at this stage in the game there are many excellent
libraries available out there that do many useful things, and they are
perfectly compatible with standard C (and quite possibly written in
standard C) even if they aren't specced by the C standard as being
officially part of the language. Not being required by the standard
doesn't make them any less "standard C".

--
Don Bruder - da****@sonic.net - If your "From:" address isn't on my whitelist,
or the subject of the message doesn't contain the exact text "PopperAndShadow"
somewhere, any message sent to this address will go in the garbage without my
ever knowing it arrived. Sorry... <http://www.sonic.net/~dakiddfor more info
Apr 2 '08 #3
Don Bruder wrote:
In article <65*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>Mahendra Kutare wrote:
>>Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.
Not in standard C, there are plenty of extensions (POSIX regex for example).

Not being required by the standard doesn't make them any less "standard C".
OK, to disambiguate my reply further, regular expressions are not part
of the standard library.

--
Ian Collins.
Apr 2 '08 #4
On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ia******@hotmail.com>
wrote in comp.lang.c:
Mahendra Kutare wrote:
Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.
Not in standard C, there are plenty of extensions (POSIX regex for example).
I disagree, one most certainly can.

There are no functions for doing this in the standard library, so one
would have to either write them, or find a library that already
contained them. But such a library could be written in strictly
conforming C, at least for the ASCII character set.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Apr 2 '08 #5
Jack Klein wrote:
On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ia******@hotmail.com>
wrote in comp.lang.c:
>Mahendra Kutare wrote:
>>Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.
Not in standard C, there are plenty of extensions (POSIX regex for example).

I disagree, one most certainly can.

There are no functions for doing this in the standard library, so one
would have to either write them, or find a library that already
contained them. But such a library could be written in strictly
conforming C, at least for the ASCII character set.
Didn't you see the clarification I posted an hour earlier?

--
Ian Collins.
Apr 2 '08 #6
On Wed, 02 Apr 2008 17:23:03 +1300, Ian Collins <ia******@hotmail.com>
wrote in comp.lang.c:
Jack Klein wrote:
On Wed, 02 Apr 2008 15:36:41 +1300, Ian Collins <ia******@hotmail.com>
wrote in comp.lang.c:
Mahendra Kutare wrote:
Or do we need to have any specific library ?

I am more interested in knowing if we can do string pattern matching
regular expression processing with C.

Not in standard C, there are plenty of extensions (POSIX regex for example).
I disagree, one most certainly can.

There are no functions for doing this in the standard library, so one
would have to either write them, or find a library that already
contained them. But such a library could be written in strictly
conforming C, at least for the ASCII character set.
Didn't you see the clarification I posted an hour earlier?
Actually, I didn't, nor Don Bruder's reply that prompted it, otherwise
I would not have posted the amplification.

SuperNews just switched their servers on March 31, and my feed has
been a bit spotty since. Hopefully they'll have it squared away in
another day or two.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Apr 3 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
3
by: Tom | last post by:
I have struggled with the issue of whether or not to use Regular Expressions for a long time now, and after implementing many text manipulating solutions both ways, I've found that writing...
1
by: MJ | last post by:
Hi I want to know what mean by regular expression in C++ Mayur
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
1
by: Don | last post by:
I've created a regular expression to match everything from the word "const" to the end of the last line that doesn't end in a space-underscore characters. i.e. ...
2
by: Brian Kitt | last post by:
I have a process where I do some minimal reformating on a TAB delimited document to prepare for DTS load. This process has been running fine, but I recently made a change. I have a Full Text...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
5
by: Avi Kak | last post by:
Folks, Does regular expression processing in Python allow for executable code to be embedded inside a regular expression? For example, in Perl the following two statements $regex =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.