| | |
regular expressions
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
Please don't make your questions such a puzzle. You mention Regular Expressions in the subject, and "parsing HTML" in the post. You need to "get" certain tags. You need help. There is no question per se in your post. Instead of giving us clues pointing vaguely toward a possible question, why not just ask a clear, specific question?
How, exactly, are you "parsing" the HTML? Are you reading the raw HTML via a Stream? Using an HTML DOM object? What does RegEx have to do with this?
How, exactly, are you "parsing" the HTML? Are you reading the raw HTML via a Stream? Using an HTML DOM object? What does RegEx have to do with this?
Last edited by tgreer; Apr 24th, 2008 at 6:20 pm.
>"<img.*src\\s*=\\s*(?:\"(?<1>[^\"]*)\"|(?<1\\S+))" but it doesnt work
Erm, why not just this?
All you're doing is checking a specific tag to see if it has an alt attribute, right?
Erm, why not just this?
C# Syntax (Toggle Plain Text)
private HasAttribute ( string src, string tag, string attribute ) { string query = "<" + tag + ".+" + attribute + ".+>"; //... }
I'm here to prove you wrong.
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
•
•
•
•
I am reading raw html via a stream and need to look for the tags such as, img, object, and applet to check they have any alt attributes. I am using regular expressions.
i was using this regular expression to find images :
"<img.*src\\s*=\\s*(?:\"(?<1>[^\"]*)\"|(?<1\\S+))" but it doesnt work
I would use basic string functions for this, searching for my target tag and then searching for the alt attribute within the tag.
![]() |
Similar Threads
- Regular Expressions with Decimal Points (Java)
- Regular Expressions (VB.NET)
- Parsing a log file using regular expressions (C#)
- PHP4 regular expressions? (PHP)
- Regular Expressions (C#)
- Regular Expressions (Computer Science)
- Regular Expressions (C#)
- mod_rewrite: help with regular expressions (Linux Servers and Apache)
- matching regular expressions (Java)
Other Threads in the C# Forum
- Previous Thread: Get number from line
- Next Thread: how to add database into the while iam deploying.
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development dll draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml






