Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Regular Expression

Reply
Thread Tools

Regular Expression

 
 
Meisam Ganjeali
Guest
Posts: n/a
 
      02-18-2005
hi all
how can i use regular expression in c and how can i strip html tags
from one string with c.
thanks.

 
Reply With Quote
 
 
 
 
Randy Howard
Guest
Posts: n/a
 
      02-18-2005
In article <(E-Mail Removed) .com>,
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Meisam Ganjeali
Guest
Posts: n/a
 
      02-18-2005
thanks a lot for your replay
any one have source sample for using regular expression.

 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      02-18-2005

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

 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      02-18-2005
In article <(E-Mail Removed) .com>,
Meisam Ganjeali <(E-Mail Removed)> 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?
 
Reply With Quote
 
yyzzz
Guest
Posts: n/a
 
      02-26-2005
Check regex (GNU regex manual)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seek xpath expression where an attribute name is a regular expression GIMME XML 3 12-29-2008 03:11 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C++ 42 11-04-2008 12:39 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C Programming 45 11-04-2008 12:39 PM
Matching abitrary expression in a regular expression =?iso-8859-1?B?bW9vcJk=?= Java 8 12-02-2005 12:51 AM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments