Regular Expression


#1

How i can find the regex of img tag scr from decoded html string in controller?


#2

… you can find it by Google.


#3

(post edit: uh-oh, looks like the OP asked this question 2 years ago and this was responded to only recently by the previous poster)

It’s much more reliable if you could access the DOM and directly do something like:

var myImage = document.getElementById("myImageTag").src; (Where myImageTag would be an img id)

Parsing HTML using regex usually leads to a lot of pain. Note that you could instantiate a DOM object from a HTML content as well, like this.


#4

Your image could be a variable

$scope.img.src?


#5

not sure what you mean. the original question stated there was an HTML string he needed parsed.