| | |
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 backup barchart bitmap box broadcast buttons c# check checkbox client clock combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees developer development draganddrop drawing dynamiccreation encryption enum excel file form format forms function gdi+ hospitalmanagementsystems httpwebrequest image index input install interface java label list listbox mandelbrot math microsystems mouseclick mysql operator password path photoshop picturebox pixelinversion post priviallages. programming property radians regex remoting richtextbox running... serialization server sleep soap socket sql sqlserver stack statistics stream string table temperature text textbox thread time timer update usercontrol validation visualstudio webbrowser windows windowsformsapplication winforms wpf write xml






