August 6th, 2013, 01:03 PM
Regular Expression Needed
I need a regular expression pattern for the following.
<a class="member"><img src="images/members/somebody-s.jpg" /><span><img src="images/members/somebody.jpg" /></span></a>
The original code shows a small image and if hovered over a large image appears. I am trying to scan a table to extract the img tag for the small image to use in further processing.
<img src="images/members/somebody-s.jpg" />
I will use:
August 6th, 2013, 01:07 PM
Don't use regular expressions for parsing HTML. Load it up in something that can properly parse HTML (what language are you using?) and grab the <img> tag using whatever mechanisms it gives you.
August 6th, 2013, 01:11 PM
August 6th, 2013, 02:15 PM
Yes: load the string up in something that can properly parse HTML and grab the <img> tag using whatever mechanisms it gives you.
Originally Posted by denmarks
How are you getting the string? AJAX? innerHTML?
August 6th, 2013, 02:44 PM
It is being extracted from a table as I move through it.
Originally Posted by requinix
I ended up using:
var theString = rowCell.innerHTML