Regular Expression

Discussion in 'C Programming' started by Meisam Ganjeali, Feb 18, 2005.

  1. hi all
    how can i use regular expression in c and how can i strip html tags
    from one string with c.
    thanks.
     
    Meisam Ganjeali, Feb 18, 2005
    #1
    1. Advertising

  2. Meisam Ganjeali

    Randy Howard Guest

    In article <>,
    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
     
    Randy Howard, Feb 18, 2005
    #2
    1. Advertising

  3. thanks a lot for your replay
    any one have source sample for using regular expression.
     
    Meisam Ganjeali, Feb 18, 2005
    #3
  4. Meisam Ganjeali

    Default User Guest

    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
     
    Default User, Feb 18, 2005
    #4
  5. In article <>,
    Meisam Ganjeali <> 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?
     
    Walter Roberson, Feb 18, 2005
    #5
  6. Meisam Ganjeali

    yyzzz Guest

    Check regex (GNU regex manual)
     
    yyzzz, Feb 26, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith-Earl
    Replies:
    1
    Views:
    468
    Mary Chipman
    Jun 15, 2004
  2. VSK
    Replies:
    2
    Views:
    2,354
  3. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    873
    Alan Moore
    Dec 2, 2005
  4. GIMME
    Replies:
    3
    Views:
    12,025
    vforvikash
    Dec 29, 2008
  5. Noman Shapiro
    Replies:
    0
    Views:
    245
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page