| | |
c++ count html tags
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
>You could tokenize (strtok) by "<" and stick each piece into a vector or so... then get it's size().
Best not to mix c with c++. Naughty naughty :-0
In any case all these suggestions are too niave. There are a few examples which will slip through the loop, (html attributes)
http://haacked.com/archive/2004/10/2...matchhtml.aspx
So using regular expressions, would be the best way to deal with this however, if this is homework your professor is unlikely to care.
Best not to mix c with c++. Naughty naughty :-0
In any case all these suggestions are too niave. There are a few examples which will slip through the loop, (html attributes)
http://haacked.com/archive/2004/10/2...matchhtml.aspx
So using regular expressions, would be the best way to deal with this however, if this is homework your professor is unlikely to care.
*Voted best profile in the world*
•
•
Join Date: Apr 2009
Posts: 8
Reputation:
Solved Threads: 0
I got it working guys
Code I used below :
works a treat
, Thanks for all your help.
Code I used below : C++ Syntax (Toggle Plain Text)
if (c=='<' ) { istag = true; } if (c== '>' && istag == true) { amounttag++; istag = false; } if (c== '!') { iscomment = true; } if ( c== '-' && iscomment == true) { amountcomment++; amounttag --; iscomment = false; }
works a treat
, Thanks for all your help. Last edited by mat1989; Apr 6th, 2009 at 12:51 pm. Reason: code nbt displaying correct
![]() |
Similar Threads
- HTML tags validator (C)
- Single Field across two columns? (ASP)
- Code tags whine-a-thon (DaniWeb Community Feedback)
- Games in Geek's Lounge (DaniWeb Community Feedback)
- get html element value using php (PHP)
- printing webpages (JavaScript / DHTML / AJAX)
- Expandable html? (JavaScript / DHTML / AJAX)
- This ought to be simple - extra spaces (PHP)
- Use Java to remove a block of html from a number of files? (Java)
Other Threads in the C++ Forum
- Previous Thread: Simple Quadratic Equation Solver - C++ - Do You Have Any Advices Would Like to Give?
- Next Thread: fstream to int
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






