469,921 Members | 2,179 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

Regular Expression

hi all
how can i use regular expression in c and how can i strip html tags
from one string with c.
thanks.

Nov 14 '05 #1
5 1328
In article <11**********************@z14g2000cwz.googlegroups .com>,
ga******@gmail.com says...
hi all
how can i use regular expression in c
Write code to handle regular expressions in c, then use it in your
program. There is no ANSI/ISO standard function to handle this
directly, but you can write your own, or obtain one elsewhere.

If you try to write one and run into trouble, you might get some
good help here. Discussing third-party implementations of it are
generally OT here.
and how can i strip html tags from one string with c.


Same answer.

--
Randy Howard (2reply remove FOOBAR)
"Making it hard to do stupid things often makes it hard
to do smart ones too." -- Andrew Koenig
Nov 14 '05 #2
thanks a lot for your replay
any one have source sample for using regular expression.

Nov 14 '05 #3

Meisam Ganjeali wrote:
hi all
how can i use regular expression in c and how can i strip html tags
from one string with c.
thanks.


I'd suggest searching for C base regex libraries using Google. You can
probably find a strip_tags() routine of some sort too. Most problems
have been solved at some point and often available free (with the
caveate that sometimes you get what you pay for).

Requests for code are not topical here.

Brian

Nov 14 '05 #4
In article <11**********************@z14g2000cwz.googlegroups .com>,
Meisam Ganjeali <ga******@gmail.com> wrote:
:how can i use regular expression in c and how can i strip html tags
:from one string with c.

html cannot be properly analyzed as regular expressions. html allows
nested entities (e.g., nested tables), but regular expressions cannot
be used to match beginning and endpoints -- regular expressions are
not powerful enough to remember how many of something have been seen.

If you do not have a firm requirement to write in C, then I suggest
that you consider using perl with the LWP module. All of the code
for extracting tags properly has already been implimented in perl.
XML and SGML parsing modules are also readily available.

If you -do- have a firm requirement to write in C, then you could
look at the perl LWP module for algorithm ideas. Or you could
generate libperl and call upon that from your C program to do the work
for you. perl itself is written in C, and can be called as library
functions relatively easily.
--
How does Usenet function without a fixed point?
Nov 14 '05 #5
Check regex (GNU regex manual)

Nov 14 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Buddy | last post: by
4 posts views Thread by Neri | last post: by
11 posts views Thread by Dimitris Georgakopuolos | last post: by
3 posts views Thread by James D. Marshall | last post: by
7 posts views Thread by Billa | last post: by
9 posts views Thread by Pete Davis | last post: by
25 posts views Thread by Mike | last post: by
1 post views Thread by NvrBst | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.