|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
IMG tag regular expression
I have a string full of HTML.
Basically, I'd like a regular expression to extract the URLs in the src="" attribute from all the IMG tags. Right now I have this: <script> var cElem = content; // var filled with HTML and IMG tags sReg = /<IMG.+?src\s*=\s*([\"']?)(.+?[\.jpg|\.gif\|\.png])([\"']).*?>/i; matchArr = cElem.match(sReg); alert(matchArr); </script> But, it isn't working at the moment... do any of you have a regexp i could use? Thanks dbalatero |
|
#2
|
||||
|
||||
|
your code looks very confusing, what is it you are trying to do exactly??
colton22 email me at colton22@comcast.net |
|
#3
|
||||
|
||||
|
Dom
It might be worth a try using the DOM getAttribute instead of regex if you want the img tag's src attribute value.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > IMG tag regular expression |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|