I'm trying to extract all html tags from a string using PHP. I use the following regexp:
If the string contains "<img src="image.jpg"><span id="spanID">Text Here</span>" the regex gives me the desired result. However if I have a string like: "<img alt="Image title >> Image description" src="image.jpg"> <span id="spanID">Text Here</span>" it doesn't return me the expected results. This is because the regex doesn't ignore the right arrow(s) (from ALT) between single or double quotes. Any ideas how this can be solved? I prefer to use a single regex to solve this, without using any other PHP functions.