Regular Expression

M

Meisam Ganjeali

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

Randy Howard

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.
 
M

Meisam Ganjeali

thanks a lot for your replay
any one have source sample for using regular expression.
 
D

Default User

Meisam said:
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
 
W

Walter Roberson

: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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top