473,386 Members | 1,832 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.

regexp confusion

MD
What do most of the experienced programmers here do when they
encounter a situation, constrained to a C programming env obviously,
where they could
use a regexp system?

I find the regcomp(), regexec(),system a little unwieldy, especially
when
dealing with user inputted expressions. Is there example code someone
can point
me to as a howto on dealing with regexp issues?
Nov 14 '05 #1
3 1382
Quoth MD on or about 2004-11-15:
I find the regcomp(), regexec(),system a little unwieldy, especially


Allow me to jump in before the *real* zealots.

regcomp et al are part of the POSIX standard. In c.l.c parlance, this
means they are not standard C!

To the best of my knowledge, standard C has no functions for
manipulating regular expressions. I suggest you try
comp.programmer.unix, before you are shouted at.

-trent
Nov 14 '05 #2
On Mon, 15 Nov 2004 08:07:36 -0800, MD wrote:
What do most of the experienced programmers here do when they encounter
a situation, constrained to a C programming env obviously, where they
could
use a regexp system?

I find the regcomp(), regexec(),system a little unwieldy, especially
when
dealing with user inputted expressions. Is there example code someone
can point
me to as a howto on dealing with regexp issues?


The C Standard does not provide any real regular expression functionality,
the functions you referenced are part of the POSIX standard which is not
discussed here. You should post your question over at
comp.unix.programmer where this will be on-topic.

<OT>
I am not sure what you mean by unwieldly, the functions are fairly
straight-forward. My personal preference is the pcre library (not part of
any standard) which implements powerful regex functionality of the Perl
language and is well documented. You can learn more at www.pcre.org.
</OT>

Rob Gamble
Nov 14 '05 #3
ma*******@gmail.com (MD) wrote:
What do most of the experienced programmers here do when they
encounter a situation, constrained to a C programming env obviously,
where they could use a regexp system?
In comp.lang.c, find one of the many libraries which implement regexes
in ISO C. There's no function in the Standard which implements them
directly, but it's quite possible to write some in nothing but ISO C.
I find the regcomp(), regexec(),system a little unwieldy, especially
when dealing with user inputted expressions.


Neither regcomp() nor regexec() are Standard. If they're POSIX, ask in
comp.unix.programmer.

Richard
Nov 14 '05 #4

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

Similar topics

10
by: Anand Pillai | last post by:
To search a word in a group of words, say a paragraph or a web page, would a string search or a regexp search be faster? The string search would of course be, if str.find(substr) != -1:...
5
by: Lukas Holcik | last post by:
Hi everyone! How can I simply search text for regexps (lets say <a href="(.*?)">(.*?)</a>) and save all URLs(1) and link contents(2) in a dictionary { name : URL}? In a single pass if it could....
0
by: Chris Croughton | last post by:
I'm trying to use the EXSLT regexp package from http://www.exslt.org/regexp/functions/match/index.html (specifically the match function) with the libxml xltproc (which supports EXSLT), but...
4
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
26
by: Matt Kruse | last post by:
Are there any current browsers that have Javascript support, but not RegExp support? For example, cell phone browsers, blackberrys, or other "minimal" browsers? I know that someone using Netscape...
7
by: Csaba Gabor | last post by:
I need to come up with a function function regExpPos (text, re, parenNum) { ... } that will return the position within text of RegExp.$parenNum if there is a match, and -1 otherwise. For...
11
by: HopfZ | last post by:
I coudn't understand some behavior of RegExp.test function. Example html code: ---------------- <html><head></head><body><script type="text/javascript"> var r = /^https?:\/\//g;...
6
by: runsun pan | last post by:
Hi I am wondering why I couldn't get what I want in the following 3 cases of re: (A) var p=/(+-?+):(+)/g p.exec("style='font-size:12'") -- // expected
4
by: Matt | last post by:
Hello all, I have just discovered (the long way) that using a RegExp object with the 'global' flag set produces inconsistent results when its test() method is executed. I realize that 'global'...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.